summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/parser/Parser.y.pp2
-rw-r--r--testsuite/tests/parser/should_compile/T5682.hs12
-rw-r--r--testsuite/tests/parser/should_compile/all.T1
3 files changed, 15 insertions, 0 deletions
diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp
index 1715f6cc2f..d2bc463b62 100644
--- a/compiler/parser/Parser.y.pp
+++ b/compiler/parser/Parser.y.pp
@@ -1155,6 +1155,8 @@ atype :: { LHsType RdrName }
| SIMPLEQUOTE '(' ')' { LL $ HsTyVar $ getRdrName unitDataCon }
| SIMPLEQUOTE '(' ctype ',' comma_types1 ')' { LL $ HsExplicitTupleTy [] ($3 : $5) }
| SIMPLEQUOTE '[' comma_types0 ']' { LL $ HsExplicitListTy placeHolderKind $3 }
+ | SIMPLEQUOTE '(' qconop ')' { LL $ HsTyVar (unLoc $3) }
+ | SIMPLEQUOTE '(' varop ')' { LL $ HsTyVar (unLoc $3) }
| '[' ctype ',' comma_types1 ']' { LL $ HsExplicitListTy placeHolderKind ($2 : $4) }
| INTEGER {% mkTyLit $ LL $ HsNumTy $ getINTEGER $1 }
| STRING {% mkTyLit $ LL $ HsStrTy $ getSTRING $1 }
diff --git a/testsuite/tests/parser/should_compile/T5682.hs b/testsuite/tests/parser/should_compile/T5682.hs
new file mode 100644
index 0000000000..bfd6752cd1
--- /dev/null
+++ b/testsuite/tests/parser/should_compile/T5682.hs
@@ -0,0 +1,12 @@
+{-# LANGUAGE DataKinds, DeriveDataTypeable, StandaloneDeriving, TypeOperators #-}
+
+module T5682 where
+
+import Data.Typeable
+
+data a :+: b = Mk a b
+data Foo = Bool :+: Bool
+
+type X = True ':+: False
+
+deriving instance Typeable '(:+:) \ No newline at end of file
diff --git a/testsuite/tests/parser/should_compile/all.T b/testsuite/tests/parser/should_compile/all.T
index 1129856119..e9cc99e959 100644
--- a/testsuite/tests/parser/should_compile/all.T
+++ b/testsuite/tests/parser/should_compile/all.T
@@ -96,3 +96,4 @@ test('T5243', extra_clean(['T5243A.hi', 'T5243A.o']),
multimod_compile, ['T5243',''])
test('T7118', normal, compile, [''])
test('T7776', normal, compile, [''])
+test('T5682', normal, compile, ['']) \ No newline at end of file