aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/analysis/inference.lux
diff options
context:
space:
mode:
authorEduardo Julian2017-11-13 20:02:18 -0400
committerEduardo Julian2017-11-13 20:02:18 -0400
commit2a3946e713821880ecc47580e754315349f2fe73 (patch)
tree7c32a522dff9d09293a5265baa968bc04137c944 /new-luxc/source/luxc/lang/analysis/inference.lux
parentca297162d5416a8c7b8af5f27757900d82d3ad03 (diff)
- Type-vars no longer get deleted.
- Fixed some bugs.
Diffstat (limited to 'new-luxc/source/luxc/lang/analysis/inference.lux')
-rw-r--r--new-luxc/source/luxc/lang/analysis/inference.lux12
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)]))
_