diff options
author | Alex AUVOLAT <alex.auvolat@ens.fr> | 2014-01-07 14:57:25 +0100 |
---|---|---|
committer | Alex AUVOLAT <alex.auvolat@ens.fr> | 2014-01-07 14:57:25 +0100 |
commit | f6b4cc449e4531b61d20f9c5544db4a8bedb7d1c (patch) | |
tree | 67c87bceb52648e95ba8e0f542f3d48f8123102f /src | |
parent | 76c451e6fb2e5d6b377d79a85e807bb238803bc1 (diff) | |
download | LPC-Projet-f6b4cc449e4531b61d20f9c5544db4a8bedb7d1c.tar.gz LPC-Projet-f6b4cc449e4531b61d20f9c5544db4a8bedb7d1c.zip |
Reject casts from **A to **B, even if B is a superclass of A.
Diffstat (limited to 'src')
-rw-r--r-- | src/typing.ml | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/typing.ml b/src/typing.ml index c5a44e3..c76c042 100644 --- a/src/typing.ml +++ b/src/typing.ml @@ -177,6 +177,7 @@ let rec subtype env a b = match a, b with | T_Int, T_Int -> true | T_Void, T_Void -> true | Typenull, TPoint(_) -> true + | TPoint(TPoint(TClass(_))), TPoint(TPoint(_)) -> false | TPoint(ka), TPoint(kb) -> subtype env ka kb | TClass(i), TClass(j) -> let c = get_c env i in |