on master help sign in
Fix record constructor for extension
commit28d256876d48817f6a1e7a6f68320f3590db670a authorEvan Czaplicki <info@elm-lang.org> dateFri 2 Aug 2013, 10:51 (13 years ago) parent070d02c
1 file changed+3−3
compiler/Type/Constrain/Declaration.hs+3−3
compiler/Type/Constrain/Declaration.hs+3−3
@@ -42,9 +42,9 @@ toDefs decl =
4242 vars = take (length args) arguments
4343
4444 efields = zip (map fst fields) (map var vars)
45− record = Src.none $ case ext of
46− Type.EmptyRecord -> Src.Record efields
47− _ -> Src.Modify (var $ last vars) efields
45+ record = case ext of
46+ Type.EmptyRecord -> Src.none $ Src.Record efields
47+ _ -> foldl (\r (f,v) -> Src.none $ Src.Insert r f v) (var $ last vars) efields
4848
4949 -- Type aliases must be added to an extended equality dictionary,
5050 -- but they do not require any basic constraints.