Coercible does not resolve type family application
With GND implemented using Coercible
(See #8503 (closed)) the test for #4185 (closed) fails. A minimal example is:
{-# LANGUAGE TypeFamilies #-}
module CoerceNewtypeFamily where
import GHC.Exts
data family Foo k
newtype instance Foo Int = FooInt Int
x :: Foo Int -> Int
x = coerce
yielding
[1 of 1] Compiling CoerceNewtypeFamily ( CoerceNewtypeFamily.hs, CoerceNewtypeFamily.o )
CoerceNewtypeFamily.hs:11:5:
No instance for (Coercible (Foo Int) Int)
because ‛Foo Int’ and ‛Int’ are different types.
arising from a use of ‛coerce’
In the expression: coerce
In an equation for ‛x’: x = coerce
I guess the Coercible
finding code needs to simply type family equations if possible.
Trac metadata
Trac field | Value |
---|---|
Version | 7.6.3 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Compiler (Type checker) |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |