git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #1613 from purescript/1175

Fix #1175

commit710666966e18b2f081a6ccb018d2142a6ab8ac52 authorPhil Freeman <paf31@cantab.net> dateSat 7 Nov 2015, 14:57 (11 years ago) parent1ae09f0522a99b
2 files changed+16−1
examples/failing/1175.purs+11 src/Language/PureScript/Sugar/TypeDeclarations.hs+5−1
examples/failing/1175.pursnew file+11
@@ -0,0 +1,11 @@
1+-- @shouldFailWith TypesDoNotUnify
2+module X where
3+
4+class Foo where
5+ foo :: String
6+
7+instance f :: Foo where
8+ foo = "a"
9+ where
10+ bar :: String
11+ bar = 1
src/Language/PureScript/Sugar/TypeDeclarations.hs+5−1
@@ -61,9 +61,13 @@ desugarTypeDeclarationsModule ms = forM ms $ \(Module ss coms name ds exps) ->
6161 let (_, f, _) = everywhereOnValuesTopDownM return go return
6262 f' (Left gs) = Left <$> mapM (pairM return f) gs
6363 f' (Right v) = Right <$> f v
64− (:) <$> (ValueDeclaration name nameKind bs <$> f' val) <*> desugarTypeDeclarations rest
64+ (:) <$> (ValueDeclaration name nameKind bs <$> f' val)
65+ <*> desugarTypeDeclarations rest
6566 where
6667 go (Let ds val') = Let <$> desugarTypeDeclarations ds <*> pure val'
6768 go other = return other
69+ desugarTypeDeclarations (TypeInstanceDeclaration nm deps cls args (ExplicitInstance ds) : rest) =
70+ (:) <$> (TypeInstanceDeclaration nm deps cls args . ExplicitInstance <$> desugarTypeDeclarations ds)
71+ <*> desugarTypeDeclarations rest
6872 desugarTypeDeclarations (d:ds) = (:) d <$> desugarTypeDeclarations ds
6973 desugarTypeDeclarations [] = return []