git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Fix issue 2128 (#2144)
9572706Ben James
CONTRIBUTORS.md+1
@@ -71,6 +71,7 @@ This file lists the contributors to the PureScript compiler project, and the ter
71- [@zudov](https://github.com/zudov) (Konstantin Zudov) My existing contributions and all future contributions until further notice are Copyright Konstantin Zudov, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
71- [@zudov](https://github.com/zudov) (Konstantin Zudov) My existing contributions and all future contributions until further notice are Copyright Konstantin Zudov, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
72- [@LiamGoodacre](https://github.com/LiamGoodacre) (Liam Goodacre) My existing contributions and all future contributions until further notice are Copyright Liam Goodacre, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
72- [@LiamGoodacre](https://github.com/LiamGoodacre) (Liam Goodacre) My existing contributions and all future contributions until further notice are Copyright Liam Goodacre, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
73- [@bsermons](https://github.com/bsermons) (Brian Sermons) My existing contributions and all future contributions until further notice are Copyright Brian Sermons, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
73- [@bsermons](https://github.com/bsermons) (Brian Sermons) My existing contributions and all future contributions until further notice are Copyright Brian Sermons, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
74+- [@bmjames](https://github.com/bmjames) (Ben James) My existing contributions and all future contributions until further notice are Copyright Ben James, and are licensed to the owners and users of the PureScript compiler project under the terms of the [MIT license](http://opensource.org/licenses/MIT).
74
75
75### Companies
76### Companies
76
77
examples/failing/2128-class.pursnew file+5
@@ -0,0 +1,5 @@
1+-- @shouldFailWith ErrorParsingModule
2+module Main where
3+
4+class Foo a where
5+ foo :: a -> !!!
examples/failing/2128-instance.pursnew file+8
@@ -0,0 +1,8 @@
1+-- @shouldFailWith ErrorParsingModule
2+module Main where
3+
4+class Foo a where
5+ foo :: a
6+
7+instance fooInt :: Foo Int where
8+ foo = !!!
src/Language/PureScript/Parser/Declarations.hs+2−2
@@ -182,7 +182,7 @@ parseTypeClassDeclaration = do
182 return implies
182 return implies
183 className <- indented *> properName
183 className <- indented *> properName
184 idents <- P.many (indented *> kindedIdent)
184 idents <- P.many (indented *> kindedIdent)
185− members <- P.option [] . P.try $ do
185+ members <- P.option [] $ do
186 indented *> reserved "where"
186 indented *> reserved "where"
187 indented *> mark (P.many (same *> positioned parseTypeDeclaration))
187 indented *> mark (P.many (same *> positioned parseTypeDeclaration))
188 return $ TypeClassDeclaration className idents implies members
188 return $ TypeClassDeclaration className idents implies members
@@ -206,7 +206,7 @@ parseInstanceDeclaration = do
206parseTypeInstanceDeclaration :: TokenParser Declaration
206parseTypeInstanceDeclaration :: TokenParser Declaration
207parseTypeInstanceDeclaration = do
207parseTypeInstanceDeclaration = do
208 instanceDecl <- parseInstanceDeclaration
208 instanceDecl <- parseInstanceDeclaration
209− members <- P.option [] . P.try $ do
209+ members <- P.option [] $ do
210 indented *> reserved "where"
210 indented *> reserved "where"
211 mark (P.many (same *> positioned parseValueDeclaration))
211 mark (P.many (same *> positioned parseValueDeclaration))
212 return $ instanceDecl (ExplicitInstance members)
212 return $ instanceDecl (ExplicitInstance members)