git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix #267
2fcd178Phil Freeman
examples/passing/TypeSynonymInData.pursnew file+9
@@ -0,0 +1,9 @@
1+module Main where
2+
3+type A a = [a]
4+
5+data Foo a = Foo (A a) | Bar
6+
7+foo (Foo []) = Bar
8+
9+main = Debug.Trace.trace "Done"
src/Language/PureScript/TypeChecker/Types.hs+3−2
@@ -583,8 +583,9 @@ inferBinder val (ConstructorBinder ctor binders) = do
583 env <- getEnv
583 env <- getEnv
584 case M.lookup ctor (dataConstructors env) of
584 case M.lookup ctor (dataConstructors env) of
585 Just (_, ty) -> do
585 Just (_, ty) -> do
586− (_, fn) <- instantiatePolyTypeWithUnknowns (error "Data constructor types cannot contains constraints") ty
586+ (_, fn) <- instantiatePolyTypeWithUnknowns (error "Data constructor types cannot contain constraints") ty
587+ fn' <- replaceAllTypeSynonyms fn
587− go binders fn
588+ go binders fn'
588 where
589 where
589 go [] ty' = do
590 go [] ty' = do
590 _ <- subsumes Nothing val ty'
591 _ <- subsumes Nothing val ty'