Fix #14811 by wiring in $tcUnit#
authorRyan Scott <ryan.gl.scott@gmail.com>
Fri, 16 Feb 2018 18:51:27 +0000 (13:51 -0500)
committerDavid Feuer <David.Feuer@gmail.com>
Fri, 16 Feb 2018 18:51:28 +0000 (13:51 -0500)
Previously, we were skipping over `$tcUnit#` entirely when
wiring in `Typeable` tycons, resulting in #14811. Easily fixed.

Test Plan: make test TEST=T14811

Reviewers: bgamari, dfeuer

Reviewed By: dfeuer

Subscribers: dfeuer, rwbarton, thomie, carter

GHC Trac Issues: #14811

Differential Revision: https://phabricator.haskell.org/D4414

compiler/typecheck/TcTypeable.hs
testsuite/tests/typecheck/should_compile/T14811.hs [new file with mode: 0644]
testsuite/tests/typecheck/should_compile/all.T

index 6fa875b..4c2a69a 100644 (file)
@@ -345,9 +345,8 @@ mkPrimTypeableTodos
 -- Note [Built-in syntax and the OrigNameCache] in IfaceEnv for more.
 ghcPrimTypeableTyCons :: [TyCon]
 ghcPrimTypeableTyCons = concat
-    [ [ runtimeRepTyCon, vecCountTyCon, vecElemTyCon
-      , funTyCon, tupleTyCon Unboxed 0 ]
-    , map (tupleTyCon Unboxed) [2..mAX_TUPLE_SIZE]
+    [ [ runtimeRepTyCon, vecCountTyCon, vecElemTyCon, funTyCon ]
+    , map (tupleTyCon Unboxed) [0..mAX_TUPLE_SIZE]
     , map sumTyCon [2..mAX_SUM_SIZE]
     , primTyCons
     ]
diff --git a/testsuite/tests/typecheck/should_compile/T14811.hs b/testsuite/tests/typecheck/should_compile/T14811.hs
new file mode 100644 (file)
index 0000000..20c6ab9
--- /dev/null
@@ -0,0 +1,5 @@
+{-# language UnboxedTuples #-}
+module T14811 where
+
+data Foo a = Foo (# a #)
+data Bar = Bar (# #)
index c5c106a..9db9393 100644 (file)
@@ -594,3 +594,4 @@ test('T14273', normal, compile, ['-fdefer-type-errors -fno-max-valid-substitutio
 test('T14732', normal, compile, [''])
 test('T14774', [], run_command, ['$MAKE -s --no-print-directory T14774'])
 test('T14763', normal, compile, [''])
+test('T14811', normal, compile, [''])