diff options
Diffstat (limited to 'new-luxc/source/luxc/lang/analysis/inference.lux')
-rw-r--r-- | new-luxc/source/luxc/lang/analysis/inference.lux | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/new-luxc/source/luxc/lang/analysis/inference.lux b/new-luxc/source/luxc/lang/analysis/inference.lux index fea685024..e2866ac87 100644 --- a/new-luxc/source/luxc/lang/analysis/inference.lux +++ b/new-luxc/source/luxc/lang/analysis/inference.lux @@ -99,7 +99,9 @@ (-> &;Analyser Type (List Code) (Meta [Type (List Analysis)])) (case args #;Nil - (:: Monad<Meta> wrap [inferT (list)]) + (do Monad<Meta> + [_ (&;infer inferT)] + (wrap [inferT (list)])) (#;Cons argC args') (case inferT @@ -113,7 +115,7 @@ [[outputT argsA] (apply-function analyse (maybe;assume (type;apply (list varT) inferT)) args)] (do @ [? (&;with-type-env - (tc;bound? var-id)) + (tc;concrete? var-id)) ## Quantify over the type if genericity/parametricity ## is discovered. outputT' (if ? @@ -145,13 +147,13 @@ ## things together more easily. (#;Function inputT outputT) (do Monad<Meta> - [argA (&;with-stacked-errors + [[outputT' args'A] (apply-function analyse outputT args') + argA (&;with-stacked-errors (function [_] (Cannot-Infer-Argument (format "Inferred Type: " (%type inputT) "\n" " Argument: " (%code argC)))) (&;with-expected-type inputT - (analyse argC))) - [outputT' args'A] (apply-function analyse outputT args')] + (analyse argC)))] (wrap [outputT' (list& argA args'A)])) _ |