diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2016-02-18 22:05:02 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2016-02-18 22:08:16 +0100 |
commit | 206a8bf4665af216784357f6741ccf5e68dd2495 (patch) | |
tree | cac5afabf84ac0c01f17a657966a2110e1078330 /testsuite | |
parent | a008eadfaa4816be349b4fefde9b9b9edc1ca359 (diff) | |
download | haskell-206a8bf4665af216784357f6741ccf5e68dd2495.tar.gz |
Unwire Typeable representation types
In order to make this work I needed to shuffle around typechecking a bit
such that `TyCon` and friends are available during compilation of
GHC.Types. I also did a bit of refactoring of `TcTypeable`.
Test Plan: Validate
Reviewers: simonpj, austin
Subscribers: simonpj, thomie
Differential Revision: https://phabricator.haskell.org/D1906
GHC Trac Issues: #11120
Diffstat (limited to 'testsuite')
6 files changed, 92 insertions, 92 deletions
diff --git a/testsuite/tests/deSugar/should_compile/T2431.stderr b/testsuite/tests/deSugar/should_compile/T2431.stderr index 935285a0d1..0d7127df0b 100644 --- a/testsuite/tests/deSugar/should_compile/T2431.stderr +++ b/testsuite/tests/deSugar/should_compile/T2431.stderr @@ -14,6 +14,11 @@ T2431.$WRefl [InlPrag=INLINE] :: forall a. a :~: a T2431.$WRefl = \ (@ a) -> T2431.Refl @ a @ a @~ (<a>_N :: a GHC.Prim.~# a) +-- RHS size: {terms: 4, types: 8, coercions: 0} +absurd :: forall a. Int :~: Bool -> a +[GblId, Arity=1, Caf=NoCafRefs, Str=DmdType <L,U>x] +absurd = \ (@ a4) (x :: Int :~: Bool) -> case x of _ [Occ=Dead] { } + -- RHS size: {terms: 2, types: 0, coercions: 0} a :: GHC.Types.TrName [GblId, Caf=NoCafRefs, Str=DmdType] @@ -53,10 +58,5 @@ T2431.$tc:~: = GHC.Types.TyCon 9759653149176674453## 12942818337407067047## T2431.$trModule a3 --- RHS size: {terms: 4, types: 8, coercions: 0} -absurd :: forall a. Int :~: Bool -> a -[GblId, Arity=1, Caf=NoCafRefs, Str=DmdType <L,U>x] -absurd = \ (@ a4) (x :: Int :~: Bool) -> case x of _ [Occ=Dead] { } - diff --git a/testsuite/tests/ghci.debugger/scripts/print019.stderr b/testsuite/tests/ghci.debugger/scripts/print019.stderr index 2282681a4a..cc62fa16e6 100644 --- a/testsuite/tests/ghci.debugger/scripts/print019.stderr +++ b/testsuite/tests/ghci.debugger/scripts/print019.stderr @@ -7,7 +7,7 @@ These potential instances exist: instance Show TypeRep -- Defined in ‘Data.Typeable.Internal’ instance Show Ordering -- Defined in ‘GHC.Show’ - instance Show Integer -- Defined in ‘GHC.Show’ + instance Show TyCon -- Defined in ‘GHC.Show’ ...plus 30 others ...plus 10 instances involving out-of-scope types (use -fprint-potential-instances to see them all) diff --git a/testsuite/tests/roles/should_compile/Roles13.stderr b/testsuite/tests/roles/should_compile/Roles13.stderr index 31795bf90b..3bd9d88d41 100644 --- a/testsuite/tests/roles/should_compile/Roles13.stderr +++ b/testsuite/tests/roles/should_compile/Roles13.stderr @@ -2,81 +2,81 @@ ==================== Tidy Core ==================== Result size of Tidy Core = {terms: 51, types: 20, coercions: 5} +-- RHS size: {terms: 2, types: 2, coercions: 0} +a :: Wrap Age -> Wrap Age +[GblId, Arity=1, Caf=NoCafRefs, Str=DmdType] +a = \ (ds :: Wrap Age) -> ds + +-- RHS size: {terms: 1, types: 0, coercions: 5} +convert :: Wrap Age -> Int +[GblId, Arity=1, Caf=NoCafRefs, Str=DmdType] +convert = + a + `cast` (<Wrap Age>_R -> Roles13.N:Wrap[0] Roles13.N:Age[0] + :: (Wrap Age -> Wrap Age) ~R# (Wrap Age -> Int)) + -- RHS size: {terms: 2, types: 0, coercions: 0} -a :: GHC.Types.TrName +a1 :: GHC.Types.TrName [GblId, Caf=NoCafRefs, Str=DmdType] -a = GHC.Types.TrNameS "main"# +a1 = GHC.Types.TrNameS "main"# -- RHS size: {terms: 2, types: 0, coercions: 0} -a1 :: GHC.Types.TrName +a2 :: GHC.Types.TrName [GblId, Caf=NoCafRefs, Str=DmdType] -a1 = GHC.Types.TrNameS "Roles13"# +a2 = GHC.Types.TrNameS "Roles13"# -- RHS size: {terms: 3, types: 0, coercions: 0} Roles13.$trModule :: GHC.Types.Module [GblId, Caf=NoCafRefs, Str=DmdType] -Roles13.$trModule = GHC.Types.Module a a1 +Roles13.$trModule = GHC.Types.Module a1 a2 -- RHS size: {terms: 2, types: 0, coercions: 0} -a2 :: GHC.Types.TrName +a3 :: GHC.Types.TrName [GblId, Caf=NoCafRefs, Str=DmdType] -a2 = GHC.Types.TrNameS "'MkAge"# +a3 = GHC.Types.TrNameS "'MkAge"# -- RHS size: {terms: 5, types: 0, coercions: 0} Roles13.$tc'MkAge :: GHC.Types.TyCon [GblId, Caf=NoCafRefs, Str=DmdType] Roles13.$tc'MkAge = GHC.Types.TyCon - 1226019810264079099## 12180888342844277416## Roles13.$trModule a2 + 1226019810264079099## 12180888342844277416## Roles13.$trModule a3 -- RHS size: {terms: 2, types: 0, coercions: 0} -a3 :: GHC.Types.TrName +a4 :: GHC.Types.TrName [GblId, Caf=NoCafRefs, Str=DmdType] -a3 = GHC.Types.TrNameS "Age"# +a4 = GHC.Types.TrNameS "Age"# -- RHS size: {terms: 5, types: 0, coercions: 0} Roles13.$tcAge :: GHC.Types.TyCon [GblId, Caf=NoCafRefs, Str=DmdType] Roles13.$tcAge = GHC.Types.TyCon - 18304088376370610314## 1954648846714895105## Roles13.$trModule a3 + 18304088376370610314## 1954648846714895105## Roles13.$trModule a4 -- RHS size: {terms: 2, types: 0, coercions: 0} -a4 :: GHC.Types.TrName +a5 :: GHC.Types.TrName [GblId, Caf=NoCafRefs, Str=DmdType] -a4 = GHC.Types.TrNameS "'MkWrap"# +a5 = GHC.Types.TrNameS "'MkWrap"# -- RHS size: {terms: 5, types: 0, coercions: 0} Roles13.$tc'MkWrap :: GHC.Types.TyCon [GblId, Caf=NoCafRefs, Str=DmdType] Roles13.$tc'MkWrap = GHC.Types.TyCon - 12402878715225676312## 13345418993613492500## Roles13.$trModule a4 + 12402878715225676312## 13345418993613492500## Roles13.$trModule a5 -- RHS size: {terms: 2, types: 0, coercions: 0} -a5 :: GHC.Types.TrName +a6 :: GHC.Types.TrName [GblId, Caf=NoCafRefs, Str=DmdType] -a5 = GHC.Types.TrNameS "Wrap"# +a6 = GHC.Types.TrNameS "Wrap"# -- RHS size: {terms: 5, types: 0, coercions: 0} Roles13.$tcWrap :: GHC.Types.TyCon [GblId, Caf=NoCafRefs, Str=DmdType] Roles13.$tcWrap = GHC.Types.TyCon - 5278920226786541118## 14554440859491798587## Roles13.$trModule a5 - --- RHS size: {terms: 2, types: 2, coercions: 0} -a6 :: Wrap Age -> Wrap Age -[GblId, Arity=1, Caf=NoCafRefs, Str=DmdType] -a6 = \ (ds :: Wrap Age) -> ds - --- RHS size: {terms: 1, types: 0, coercions: 5} -convert :: Wrap Age -> Int -[GblId, Arity=1, Caf=NoCafRefs, Str=DmdType] -convert = - a6 - `cast` (<Wrap Age>_R -> Roles13.N:Wrap[0] Roles13.N:Age[0] - :: (Wrap Age -> Wrap Age) ~R# (Wrap Age -> Int)) + 5278920226786541118## 14554440859491798587## Roles13.$trModule a6 diff --git a/testsuite/tests/simplCore/should_compile/T7360.stderr b/testsuite/tests/simplCore/should_compile/T7360.stderr index ac570df364..b96512c471 100644 --- a/testsuite/tests/simplCore/should_compile/T7360.stderr +++ b/testsuite/tests/simplCore/should_compile/T7360.stderr @@ -21,6 +21,58 @@ T7360.$WFoo3 = T7360.Foo3 dt } +-- RHS size: {terms: 5, types: 2, coercions: 0} +fun1 [InlPrag=NOINLINE] :: Foo -> () +[GblId, Arity=1, Caf=NoCafRefs, Str=DmdType <S,1*U>] +fun1 = + \ (x :: Foo) -> + case x of _ [Occ=Dead] { __DEFAULT -> GHC.Tuple.() } + +-- RHS size: {terms: 2, types: 0, coercions: 0} +T7360.fun5 :: () +[GblId, + Str=DmdType, + Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False, + WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}] +T7360.fun5 = fun1 T7360.Foo1 + +-- RHS size: {terms: 2, types: 0, coercions: 0} +T7360.fun4 :: Int +[GblId, + Caf=NoCafRefs, + Str=DmdType m, + Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, + WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] +T7360.fun4 = GHC.Types.I# 0# + +-- RHS size: {terms: 16, types: 13, coercions: 0} +fun2 :: forall a. [a] -> ((), Int) +[GblId, + Arity=1, + Str=DmdType <L,1*U>m, + Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, + WorkFree=True, Expandable=True, + Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False) + Tmpl= \ (@ a) (x [Occ=Once!] :: [a]) -> + (T7360.fun5, + case x of wild { + [] -> T7360.fun4; + : _ [Occ=Dead] _ [Occ=Dead] -> + case GHC.List.$wlenAcc @ a wild 0# of ww2 { __DEFAULT -> + GHC.Types.I# ww2 + } + })}] +fun2 = + \ (@ a) (x :: [a]) -> + (T7360.fun5, + case x of wild { + [] -> T7360.fun4; + : ds ds1 -> + case GHC.List.$wlenAcc @ a wild 0# of ww2 { __DEFAULT -> + GHC.Types.I# ww2 + } + }) + -- RHS size: {terms: 2, types: 0, coercions: 0} T7360.$trModule2 :: GHC.Types.TrName [GblId, @@ -141,57 +193,5 @@ T7360.$tcFoo = T7360.$trModule T7360.$tcFoo1 --- RHS size: {terms: 5, types: 2, coercions: 0} -fun1 [InlPrag=NOINLINE] :: Foo -> () -[GblId, Arity=1, Caf=NoCafRefs, Str=DmdType <S,1*U>] -fun1 = - \ (x :: Foo) -> - case x of _ [Occ=Dead] { __DEFAULT -> GHC.Tuple.() } - --- RHS size: {terms: 2, types: 0, coercions: 0} -T7360.fun5 :: () -[GblId, - Str=DmdType, - Unf=Unf{Src=<vanilla>, TopLvl=True, Value=False, ConLike=False, - WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}] -T7360.fun5 = fun1 T7360.Foo1 - --- RHS size: {terms: 2, types: 0, coercions: 0} -T7360.fun4 :: Int -[GblId, - Caf=NoCafRefs, - Str=DmdType m, - Unf=Unf{Src=<vanilla>, TopLvl=True, Value=True, ConLike=True, - WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}] -T7360.fun4 = GHC.Types.I# 0# - --- RHS size: {terms: 16, types: 13, coercions: 0} -fun2 :: forall a. [a] -> ((), Int) -[GblId, - Arity=1, - Str=DmdType <L,1*U>m, - Unf=Unf{Src=InlineStable, TopLvl=True, Value=True, ConLike=True, - WorkFree=True, Expandable=True, - Guidance=ALWAYS_IF(arity=1,unsat_ok=True,boring_ok=False) - Tmpl= \ (@ a) (x [Occ=Once!] :: [a]) -> - (T7360.fun5, - case x of wild { - [] -> T7360.fun4; - : _ [Occ=Dead] _ [Occ=Dead] -> - case GHC.List.$wlenAcc @ a wild 0# of ww2 { __DEFAULT -> - GHC.Types.I# ww2 - } - })}] -fun2 = - \ (@ a) (x :: [a]) -> - (T7360.fun5, - case x of wild { - [] -> T7360.fun4; - : ds ds1 -> - case GHC.List.$wlenAcc @ a wild 0# of ww2 { __DEFAULT -> - GHC.Types.I# ww2 - } - }) - diff --git a/testsuite/tests/simplCore/should_compile/T8274.stdout b/testsuite/tests/simplCore/should_compile/T8274.stdout index 05a0069720..43830c7135 100644 --- a/testsuite/tests/simplCore/should_compile/T8274.stdout +++ b/testsuite/tests/simplCore/should_compile/T8274.stdout @@ -1,3 +1,5 @@ +p = T8274.Positives 42# 4.23# 4.23## '4'# 4## +n = T8274.Negatives -4# -4.0# -4.0## T8274.$trModule2 = GHC.Types.TrNameS "main"# T8274.$trModule1 = GHC.Types.TrNameS "T8274"# T8274.$tc'Positives1 = GHC.Types.TrNameS "'Positives"# @@ -8,5 +10,3 @@ T8274.$tc'Negatives1 = GHC.Types.TrNameS "'Negatives"# T8274.$tc'Negatives = GHC.Types.TyCon 15950179315687996644## 11481167534507418130## T8274.$trModule T8274.$tc'Negatives1 T8274.$tcN1 = GHC.Types.TrNameS "N"# T8274.$tcN = GHC.Types.TyCon 7479687563082171902## 17616649989360543185## T8274.$trModule T8274.$tcN1 -p = T8274.Positives 42# 4.23# 4.23## '4'# 4## -n = T8274.Negatives -4# -4.0# -4.0## diff --git a/testsuite/tests/stranal/should_compile/T10694.stdout b/testsuite/tests/stranal/should_compile/T10694.stdout index 64d5f7a1aa..eaffa9446f 100644 --- a/testsuite/tests/stranal/should_compile/T10694.stdout +++ b/testsuite/tests/stranal/should_compile/T10694.stdout @@ -1,5 +1,5 @@ +[GblId, Arity=2, Str=DmdType <L,U(U)><L,U(U)>m] + Str=DmdType <L,U(U)><L,U(U)>, Str=DmdType m1, Str=DmdType m1, Str=DmdType m, -[GblId, Arity=2, Str=DmdType <L,U(U)><L,U(U)>m] - Str=DmdType <L,U(U)><L,U(U)>, |