diff options
author | Tibor Erdesz <erdeszt@gmail.com> | 2017-06-29 19:37:13 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-06-29 19:38:16 -0400 |
commit | 007f255644f885d445e47e291e50eb12b5ecd08d (patch) | |
tree | 2d6269ea631c17096d9aefdf8b2551f667e0faed /testsuite | |
parent | 6171b0b326e52221a0631cf75eb4866b36abe631 (diff) | |
download | haskell-007f255644f885d445e47e291e50eb12b5ecd08d.tar.gz |
Allow optional instance keyword in associated type family instances
Add the missing branch for parsing the optional 'instance' keyword
in associated type family instance declarations.
Fixes #13747
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: simonpj, RyanGlScott, rwbarton, thomie, mpickering
Differential Revision: https://phabricator.haskell.org/D3673
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/parser/should_compile/T13747.hs | 24 | ||||
-rw-r--r-- | testsuite/tests/parser/should_compile/all.T | 1 |
2 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/tests/parser/should_compile/T13747.hs b/testsuite/tests/parser/should_compile/T13747.hs new file mode 100644 index 0000000000..749d8d2fc4 --- /dev/null +++ b/testsuite/tests/parser/should_compile/T13747.hs @@ -0,0 +1,24 @@ +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE GADTs #-} + +module T13747 where + +class C a where + type family TC a :: * + +class D a where + data family TD a :: * + +instance C Int where + type instance TC Int = Int + +instance D Double where + data instance TD Double = TDDouble + +instance D Int where + newtype instance TD Int = TDInt Int + +instance D Char where + data instance TD Char where + C1 :: TD Char + C2 :: TD Char diff --git a/testsuite/tests/parser/should_compile/all.T b/testsuite/tests/parser/should_compile/all.T index 2059979765..a9d6830701 100644 --- a/testsuite/tests/parser/should_compile/all.T +++ b/testsuite/tests/parser/should_compile/all.T @@ -107,3 +107,4 @@ test('T10582', expect_broken(10582), compile, ['']) test('DumpParsedAst', normal, compile, ['-dsuppress-uniques -ddump-parsed-ast']) test('DumpRenamedAst', normal, compile, ['-dsuppress-uniques -ddump-rn-ast']) test('DumpTypecheckedAst', normal, compile, ['-dsuppress-uniques -ddump-tc-ast']) +test('T13747', normal, compile, ['']) |