diff options
author | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2021-03-31 07:17:00 +0300 |
---|---|---|
committer | Ben Gamari <ben@well-typed.com> | 2021-04-08 09:45:21 -0400 |
commit | 2946f2eb07e47afcfe5876e091ad4dc8c567abcf (patch) | |
tree | b5d03e2d7b4dbc4b664ee1bc90bad8f21db917ea | |
parent | d197fb3d5c053cfb526272c29a443c33d1af0980 (diff) | |
download | haskell-2946f2eb07e47afcfe5876e091ad4dc8c567abcf.tar.gz |
Add missing axiom exports for CharToNat/NatToCharwip/backport-9.2-chartonat-axiom
When the CharToNat and NatToChar type families were added,
the corresponding axioms were not exported.
This led to a failure much like #14934
(cherry picked from commit d44e42a26e54857cc6174f2bb7dc86cc41fcd249)
-rw-r--r-- | compiler/GHC/Builtin/Types/Literals.hs | 2 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T14934.hs | 7 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_compile/T14934a.hs | 3 |
3 files changed, 10 insertions, 2 deletions
diff --git a/compiler/GHC/Builtin/Types/Literals.hs b/compiler/GHC/Builtin/Types/Literals.hs index 19dcba7116..273d084c96 100644 --- a/compiler/GHC/Builtin/Types/Literals.hs +++ b/compiler/GHC/Builtin/Types/Literals.hs @@ -541,6 +541,8 @@ typeNatCoAxiomRules = listToUFM $ map (\x -> (coaxrName x, x)) , axAppendSymbolDef , axConsSymbolDef , axUnconsSymbolDef + , axCharToNatDef + , axNatToCharDef , axAdd0L , axAdd0R , axMul0L diff --git a/testsuite/tests/typecheck/should_compile/T14934.hs b/testsuite/tests/typecheck/should_compile/T14934.hs index 581e93186e..c4ad6df457 100644 --- a/testsuite/tests/typecheck/should_compile/T14934.hs +++ b/testsuite/tests/typecheck/should_compile/T14934.hs @@ -5,5 +5,8 @@ module T14934 where import T14934a import GHC.TypeLits -g :: Foo (1 - 0) -g = f MkFoo1 +a :: Foo (1 - 0) +a = f MkFoo1 + +b :: Foo (CharToNat '\1') +b = g MkFoo1 diff --git a/testsuite/tests/typecheck/should_compile/T14934a.hs b/testsuite/tests/typecheck/should_compile/T14934a.hs index 3a4865fffc..c192f6a6a5 100644 --- a/testsuite/tests/typecheck/should_compile/T14934a.hs +++ b/testsuite/tests/typecheck/should_compile/T14934a.hs @@ -13,3 +13,6 @@ data Foo :: Nat -> Type where f :: Foo (1 - 0) -> Foo 1 f x = x + +g :: Foo (CharToNat '\1') -> Foo 1 +g x = x |