summaryrefslogtreecommitdiff
path: root/src/constraint.ml
diff options
context:
space:
mode:
authorAlasdair Armstrong2018-04-25 20:19:14 +0100
committerAlasdair Armstrong2018-04-25 20:23:35 +0100
commit2217a2537cc504d298da763af613f56965782274 (patch)
treed651f5241e81b684fd366ec14bc57f153b10cb90 /src/constraint.ml
parent7511b5f693d350fa0d675f0c527d0d633a0ba560 (diff)
Simplify subtyping check
This should make subtyping work better for tuples containing constrained types. Removes the intermediate type-normal-form representation from the subtyping check, and replaces it with Env.canonicalize from the canonical branch.
Diffstat (limited to 'src/constraint.ml')
-rw-r--r--src/constraint.ml3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/constraint.ml b/src/constraint.ml
index 1b9447f8..d66705b6 100644
--- a/src/constraint.ml
+++ b/src/constraint.ml
@@ -310,7 +310,8 @@ let conj (x : t) (y : t) : t =
let disj (x : t) (y : t) : t =
BFun (Or, x, y)
-let forall (vars : int list) (x : t) : t = Forall (vars, x)
+let forall (vars : int list) (x : t) : t =
+ if vars = [] then x else Forall (vars, x)
let negate (x : t) : t = Not x