[commit: ghc] master: Fix #14811 by wiring in $tcUnit# (d5ac582)

git at git.haskell.org git at git.haskell.org
Fri Feb 16 18:52:15 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/d5ac5820111bc957e72c8ce11e59d7cbbdd63526/ghc

>---------------------------------------------------------------

commit d5ac5820111bc957e72c8ce11e59d7cbbdd63526
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date:   Fri Feb 16 13:51:27 2018 -0500

    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


>---------------------------------------------------------------

d5ac5820111bc957e72c8ce11e59d7cbbdd63526
 compiler/typecheck/TcTypeable.hs                   | 5 ++---
 testsuite/tests/typecheck/should_compile/T14811.hs | 5 +++++
 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 6fa875b..4c2a69a 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 0000000..20c6ab9
--- /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 c5c106a..9db9393 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -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, [''])



More information about the ghc-commits mailing list