diff options
author | Ben Gamari <ben@smart-cactus.org> | 2017-03-27 13:17:00 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-03-31 17:37:04 -0400 |
commit | 6575f4b635a393775295798ca86c7c3ba00819be (patch) | |
tree | 6d974ae41d093ec43ac3c1d95c103a86830e6091 /testsuite/tests/roles | |
parent | 29645274a3c97a904759aa245dc8f8c03a58c601 (diff) | |
download | haskell-6575f4b635a393775295798ca86c7c3ba00819be.tar.gz |
Clean up coreView/tcView.
In Core, Constraint should be considered fully equal to
TYPE LiftedRep, in all ways. Accordingly, coreView should
unwrap Constraint to become TYPE LiftedRep. Of course, this
would be a disaster in the type checker.
So, where previously we used coreView in both the type checker
and in Core, we now have coreView and tcView, which differ only
in their treatment of Constraint.
Historical note: once upon a past, we had tcView distinct from
coreView. Back then, it was because newtypes were unwrapped in
Core but not in the type checker. The distinction is back, but
for a different reason than before.
This had a few knock-on effects:
* The Typeable solver must explicitly handle Constraint to ensure
that we produce the correct evidence.
* TypeMap now respects the Constraint/Type distinction
Finished by: bgamari
Test Plan: ./validate
Reviewers: simonpj, austin, bgamari
Reviewed By: simonpj
Subscribers: rwbarton, thomie
Differential Revision: https://phabricator.haskell.org/D3316
Diffstat (limited to 'testsuite/tests/roles')
4 files changed, 23 insertions, 9 deletions
diff --git a/testsuite/tests/roles/should_compile/Roles14.stderr b/testsuite/tests/roles/should_compile/Roles14.stderr index ce4ddd3bb7..84346b9008 100644 --- a/testsuite/tests/roles/should_compile/Roles14.stderr +++ b/testsuite/tests/roles/should_compile/Roles14.stderr @@ -19,7 +19,7 @@ Roles12.$tcC2 Roles12.$trModule (GHC.Types.TrNameS "C2"#) 0 - GHC.Types.krep$*Arr* + $krep Roles12.$tc'C:C2 = GHC.Types.TyCon 7087988437584478859## @@ -31,6 +31,9 @@ Roles12.$tc'C:C2 $krep [InlPrag=[~]] = GHC.Types.KindRepVar 0 $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun GHC.Types.krep$* $krep +$krep [InlPrag=[~]] + = GHC.Types.KindRepTyConApp GHC.Types.$tcConstraint [] $krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp Roles12.$tcC2 ((:) $krep []) Roles12.$trModule diff --git a/testsuite/tests/roles/should_compile/Roles3.stderr b/testsuite/tests/roles/should_compile/Roles3.stderr index cc9ce91a52..11abd0cd4c 100644 --- a/testsuite/tests/roles/should_compile/Roles3.stderr +++ b/testsuite/tests/roles/should_compile/Roles3.stderr @@ -40,7 +40,7 @@ Roles3.$tcC4 Roles3.$trModule (GHC.Types.TrNameS "C4"#) 0 - GHC.Types.krep$*->*->* + $krep Roles3.$tcC3 = GHC.Types.TyCon 5076086601454991970## @@ -48,7 +48,7 @@ Roles3.$tcC3 Roles3.$trModule (GHC.Types.TrNameS "C3"#) 0 - GHC.Types.krep$*->*->* + $krep Roles3.$tcC2 = GHC.Types.TyCon 7902873224172523979## @@ -56,7 +56,7 @@ Roles3.$tcC2 Roles3.$trModule (GHC.Types.TrNameS "C2"#) 0 - GHC.Types.krep$*->*->* + $krep Roles3.$tc'C:C2 = GHC.Types.TyCon 11218882737915989529## @@ -72,7 +72,7 @@ Roles3.$tcC1 Roles3.$trModule (GHC.Types.TrNameS "C1"#) 0 - GHC.Types.krep$*Arr* + $krep Roles3.$tc'C:C1 = GHC.Types.TyCon 4508088879886988796## @@ -88,6 +88,10 @@ $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun GHC.Types.krep$* $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun GHC.Types.krep$* $krep +$krep [InlPrag=[~]] + = GHC.Types.KindRepTyConApp GHC.Types.$tcConstraint [] $krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp Data.Type.Equality.$tc~ diff --git a/testsuite/tests/roles/should_compile/Roles4.stderr b/testsuite/tests/roles/should_compile/Roles4.stderr index ac9d08b415..69394d29df 100644 --- a/testsuite/tests/roles/should_compile/Roles4.stderr +++ b/testsuite/tests/roles/should_compile/Roles4.stderr @@ -25,7 +25,7 @@ Roles4.$tcC3 Roles4.$trModule (GHC.Types.TrNameS "C3"#) 0 - GHC.Types.krep$*Arr* + $krep Roles4.$tc'C:C3 = GHC.Types.TyCon 3133378316178104365## @@ -41,7 +41,7 @@ Roles4.$tcC1 Roles4.$trModule (GHC.Types.TrNameS "C1"#) 0 - GHC.Types.krep$*Arr* + $krep Roles4.$tc'C:C1 = GHC.Types.TyCon 3870707671502302648## @@ -55,9 +55,12 @@ $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun GHC.Types.krep$* $krep $krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp GHC.Types.$tc[] ((:) $krep []) $krep [InlPrag=[~]] + = GHC.Types.KindRepTyConApp GHC.Types.$tcConstraint [] +$krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp Roles4.$tcC3 ((:) $krep []) $krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp Roles4.$tcC1 ((:) $krep []) diff --git a/testsuite/tests/roles/should_compile/T8958.stderr b/testsuite/tests/roles/should_compile/T8958.stderr index bb20002c26..09b9cffc9d 100644 --- a/testsuite/tests/roles/should_compile/T8958.stderr +++ b/testsuite/tests/roles/should_compile/T8958.stderr @@ -43,7 +43,7 @@ T8958.$tcRepresentational T8958.$trModule (GHC.Types.TrNameS "Representational"#) 0 - GHC.Types.krep$*Arr* + $krep T8958.$tc'C:Representational = GHC.Types.TyCon 2358772282532242424## @@ -59,7 +59,7 @@ T8958.$tcNominal T8958.$trModule (GHC.Types.TrNameS "Nominal"#) 0 - GHC.Types.krep$*Arr* + $krep T8958.$tc'C:Nominal = GHC.Types.TyCon 10562260635335201742## @@ -71,6 +71,7 @@ T8958.$tc'C:Nominal $krep [InlPrag=[~]] = GHC.Types.KindRepVar 0 $krep [InlPrag=[~]] = GHC.Types.KindRepVar 1 $krep [InlPrag=[~]] = GHC.Types.KindRepFun $krep $krep +$krep [InlPrag=[~]] = GHC.Types.KindRepFun GHC.Types.krep$* $krep $krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp GHC.Tuple.$tc(,) @@ -87,6 +88,9 @@ $krep [InlPrag=[~]] ((:) @ GHC.Types.KindRep $krep [] @ GHC.Types.KindRep) $krep [InlPrag=[~]] = GHC.Types.KindRepTyConApp + GHC.Types.$tcConstraint [] @ GHC.Types.KindRep +$krep [InlPrag=[~]] + = GHC.Types.KindRepTyConApp T8958.$tcRepresentational ((:) @ GHC.Types.KindRep $krep [] @ GHC.Types.KindRep) $krep [InlPrag=[~]] |