on master help sign in
Fix bug in generating Def for ADT constructors

Accidentally used the type name instead of the constructor name.

commitb540fb43b0d44bcab4c44f7092dbcf253b00a1b5 authorEvan Czaplicki <info@elm-lang.org> dateFri 19 Jul 2013, 12:39 (13 years ago) parentb87e45a
1 file changed+1−1
compiler/Type/Constrain/Declaration.hs+1−1
compiler/Type/Constrain/Declaration.hs+1−1
@@ -25,7 +25,7 @@ toDefs decl =
2525 toDefs (ctor, tipes) =
2626 let vars = take (length tipes) $ map (\n -> "_" ++ show n) [0..]
2727 loc = Src.none
28− body = loc . Src.Data name $ map (loc . Src.Var) vars
28+ body = loc . Src.Data ctor $ map (loc . Src.Var) vars
2929 in [ Src.TypeAnnotation ctor $
3030 foldr Type.Lambda (Type.Data name $ map Type.Var tvars) tipes
3131 , Src.Def (Src.PVar ctor) $