summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/iface/ToIface.hs6
-rw-r--r--testsuite/tests/typecheck/should_fail/T14390.hs4
-rw-r--r--testsuite/tests/typecheck/should_fail/T14390.stderr5
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T1
4 files changed, 16 insertions, 0 deletions
diff --git a/compiler/iface/ToIface.hs b/compiler/iface/ToIface.hs
index 9eceb6d750..6f71af516e 100644
--- a/compiler/iface/ToIface.hs
+++ b/compiler/iface/ToIface.hs
@@ -195,6 +195,12 @@ toIfaceTyCon tc
| isUnboxedSumTyCon tc
, Just cons <- isDataSumTyCon_maybe tc = IfaceSumTyCon (length cons)
+ | tyConName tc == eqTyConName || tc == eqPrimTyCon
+ = IfaceEqualityTyCon True
+
+ | tc `elem` [heqTyCon, eqReprPrimTyCon]
+ = IfaceEqualityTyCon False
+
| otherwise = IfaceNormalTyCon
diff --git a/testsuite/tests/typecheck/should_fail/T14390.hs b/testsuite/tests/typecheck/should_fail/T14390.hs
new file mode 100644
index 0000000000..5360be714c
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T14390.hs
@@ -0,0 +1,4 @@
+module T14390 where
+
+import Data.Type.Equality
+instance (~~) Int Int
diff --git a/testsuite/tests/typecheck/should_fail/T14390.stderr b/testsuite/tests/typecheck/should_fail/T14390.stderr
new file mode 100644
index 0000000000..f94bf40700
--- /dev/null
+++ b/testsuite/tests/typecheck/should_fail/T14390.stderr
@@ -0,0 +1,5 @@
+
+T14390.hs:4:10: error:
+ • Illegal instance declaration for ‘(Int :: *) ~~ (Int :: *)’
+ Manual instances of this class are not permitted.
+ • In the instance declaration for ‘(~~) Int Int’
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index 1aa23c4945..ca0264b773 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -460,3 +460,4 @@ test('T13929', normal, compile_fail, [''])
test('T14232', normal, compile_fail, [''])
test('T14325', normal, compile_fail, [''])
test('T14350', normal, compile_fail, [''])
+test('T14390', normal, compile_fail, [''])