diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2018-02-16 13:51:27 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-02-18 14:59:30 -0500 |
commit | 0f78f18129d24f17154ae7dca84937fddd1f8b0c (patch) | |
tree | 268b2d7ec31d726e579a48c315a69069016c0d89 | |
parent | 43cd969d01cf4fe15432f28af500d85b52237379 (diff) | |
download | haskell-0f78f18129d24f17154ae7dca84937fddd1f8b0c.tar.gz |
Fix #14811 by wiring in $tcUnit#
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
(cherry picked from commit d5ac5820111bc957e72c8ce11e59d7cbbdd63526)
-rw-r--r-- | compiler/typecheck/TcTypeable.hs | 5 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T14811.hs | 5 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/all.T | 1 |
3 files changed, 8 insertions, 3 deletions
diff --git a/compiler/typecheck/TcTypeable.hs b/compiler/typecheck/TcTypeable.hs index 6fa875b8d3..4c2a69a6c0 100644 --- a/compiler/typecheck/TcTypeable.hs +++ b/compiler/typecheck/TcTypeable.hs @@ -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 index 0000000000..20c6ab9db1 --- /dev/null +++ b/testsuite/tests/typecheck/should_compile/T14811.hs @@ -0,0 +1,5 @@ +{-# language UnboxedTuples #-} +module T14811 where + +data Foo a = Foo (# a #) +data Bar = Bar (# #) diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T index 9583bc5f5f..f38a1ff90f 100644 --- a/testsuite/tests/typecheck/should_compile/all.T +++ b/testsuite/tests/typecheck/should_compile/all.T @@ -592,3 +592,4 @@ test('T14590', normal, compile, ['-fdefer-type-errors -fno-max-valid-substitutio test('T14273', normal, compile, ['-fdefer-type-errors -fno-max-valid-substitutions']) test('T14732', normal, compile, ['']) test('T14763', normal, compile, ['']) +test('T14811', normal, compile, ['']) |