From bcb247513c80d321fcdd20e655b666a97269c54e Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Thu, 28 Dec 2017 23:18:29 -0400 Subject: - Fixed function application involving existential quantification in the old compiler. --- luxc/src/lux/analyser/lux.clj | 19 ++++++++++++++++--- 1 file 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*) -- cgit v1.2.3