[commit: ghc] master: Give lifted primitive types a representation (a88bb1b)

git at git.haskell.org git at git.haskell.org
Thu May 19 19:31:38 UTC 2016


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

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

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

commit a88bb1b1518389817583290acaebfd6454aa3cec
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Thu May 19 21:05:30 2016 +0200

    Give lifted primitive types a representation
    
    As of D1774 everything in GHC.Prim has a representation generated for it
    by TcTypeable (see #11120). Unfortunately I evidently missed propagating
    this change to lifted primitive types. This patch fixes this (#12082).
    
    Test Plan: Validate
    
    Reviewers: austin
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2240
    
    GHC Trac Issues: #12082


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

a88bb1b1518389817583290acaebfd6454aa3cec
 compiler/types/TyCon.hs                    | 3 ++-
 testsuite/tests/typecheck/should_run/all.T | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/compiler/types/TyCon.hs b/compiler/types/TyCon.hs
index 628eabd..55f6416 100644
--- a/compiler/types/TyCon.hs
+++ b/compiler/types/TyCon.hs
@@ -1365,7 +1365,8 @@ mkLiftedPrimTyCon :: Name -> [TyBinder]
                   -> Kind   -- ^ /result/ kind
                   -> [Role] -> TyCon
 mkLiftedPrimTyCon name binders res_kind roles
-  = mkPrimTyCon' name binders res_kind roles False Nothing
+  = mkPrimTyCon' name binders res_kind roles False (Just rep_nm)
+  where rep_nm = mkPrelTyConRepName name
 
 mkPrimTyCon' :: Name -> [TyBinder]
              -> Kind    -- ^ /result/ kind
diff --git a/testsuite/tests/typecheck/should_run/all.T b/testsuite/tests/typecheck/should_run/all.T
index 74d8f84..c2b277d 100755
--- a/testsuite/tests/typecheck/should_run/all.T
+++ b/testsuite/tests/typecheck/should_run/all.T
@@ -115,5 +115,5 @@ test('T11049', exit_code(1), compile_and_run, [''])
 test('T11230', normal, compile_and_run, [''])
 test('TypeOf', normal, compile_and_run, [''])
 test('TypeRep', normal, compile_and_run, [''])
-test('T11120', expect_broken(12082), compile_and_run, [''])
+test('T11120', normal, compile_and_run, [''])
 test('KindInvariant', normal, ghci_script, ['KindInvariant.script'])



More information about the ghc-commits mailing list