diff options
author | Eduardo Julian | 2016-12-28 20:02:14 -0400 |
---|---|---|
committer | Eduardo Julian | 2016-12-28 20:02:14 -0400 |
commit | 7a9c41f33252e44f36bf667c27739e9afc3085f9 (patch) | |
tree | 691729e6cb32986bbf0b7d67245537f709f9dba6 /stdlib/source | |
parent | 4785f68c8b26775a07831ec8c92897c7235d654a (diff) |
- Fixed a bug with struct auto selection (couldn't handle mixes of vars and expressions).
- Added a test of whether the "Functor::map" function can be auto-selected.
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/lux/type/auto.lux | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/stdlib/source/lux/type/auto.lux b/stdlib/source/lux/type/auto.lux index 31439af3d..aa7074d4a 100644 --- a/stdlib/source/lux/type/auto.lux +++ b/stdlib/source/lux/type/auto.lux @@ -235,10 +235,10 @@ (list l r)) (syntax: #export (::: [member s;symbol] - [args (s;alt (s;some s;symbol) - (s;some s;any))]) + [args (s;alt (s;seq (s;some s;symbol) s;end) + (s;seq (s;some s;any) s;end))]) (case args - (#;Left args) + (#;Left [args _]) (do @ [[member-idx sig-type] (resolve-member member) input-types (mapM @ resolve-type args) @@ -260,11 +260,11 @@ (text;join-with ", ") ))))) - (#;Right args) + (#;Right [args _]) (do @ - [#let [args-to-bind (list;filter (bool;complement var?) args)] - labels (seqM @ (list;repeat (list;size args-to-bind) + [labels (seqM @ (list;repeat (list;size args) (compiler;gensym ""))) - #let [retry (` (let [(~@ (|> (list;zip2 labels args-to-bind) (List/map join-pair) List/join))] + #let [retry (` (let [(~@ (|> (list;zip2 labels args) (List/map join-pair) List/join))] (;;::: (~ (ast;symbol member)) (~@ labels))))]] - (wrap (list retry))))) + (wrap (list retry))) + )) |