[commit: ghc] ghc-8.4: Fix #14811 by wiring in $tcUnit# (a66ddb5)

git at git.haskell.org git at git.haskell.org
Sun Feb 18 19:38:37 UTC 2018


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

On branch  : ghc-8.4
Link       : http://ghc.haskell.org/trac/ghc/changeset/a66ddb5599a71c31be5f95972156e86debb3c7bf/ghc

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

commit a66ddb5599a71c31be5f95972156e86debb3c7bf
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
    
    (cherry picked from commit d5ac5820111bc957e72c8ce11e59d7cbbdd63526)


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

a66ddb5599a71c31be5f95972156e86debb3c7bf
 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 9583bc5..f38a1ff 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, [''])



More information about the ghc-commits mailing list