aboutsummaryrefslogtreecommitdiff
path: root/luxc
diff options
context:
space:
mode:
authorEduardo Julian2017-12-28 23:18:29 -0400
committerEduardo Julian2017-12-28 23:18:29 -0400
commitbcb247513c80d321fcdd20e655b666a97269c54e (patch)
tree6965739b49dddfe548630cf0d02ccd49f2eeb247 /luxc
parent52d1159dbedd7ccf158fa53578d1916032a662ce (diff)
- Fixed function application involving existential quantification in the old compiler.
Diffstat (limited to '')
-rw-r--r--luxc/src/lux/analyser/lux.clj19
1 files changed, 16 insertions, 3 deletions
diff --git a/luxc/src/lux/analyser/lux.clj b/luxc/src/lux/analyser/lux.clj
index 18941a0e3..1ef5a4b09 100644
--- a/luxc/src/lux/analyser/lux.clj
+++ b/luxc/src/lux/analyser/lux.clj
@@ -337,9 +337,22 @@
))))
(&/$ExQ _)
- (|do [$var &type/existential
- type* (&type/apply-type ?fun-type* $var)]
- (analyse-apply* analyse exo-type type* ?args))
+ (&type/with-var
+ (fn [$var]
+ (|do [type* (&type/apply-type ?fun-type* $var)
+ [=output-t =args] (analyse-apply* analyse exo-type type* ?args)
+ ==args (&/map% (partial &&/clean-analysis $var) =args)]
+ (|case $var
+ (&/$Var ?id)
+ (|do [? (&type/bound? ?id)
+ type** (if ?
+ (&type/clean $var =output-t)
+ (|do [idT &type/existential
+ _ (&type/set-var ?id idT)]
+ (&type/clean $var =output-t)))
+ _ (&type/clean $var exo-type)]
+ (return (&/T [type** ==args])))
+ ))))
(&/$Function ?input-t ?output-t)
(|do [[=output-t =args] (analyse-apply* analyse exo-type ?output-t ?args*)