Skip to content

Representational equalities over AppTys are not hard failures

If I say

module App where

import Data.Coerce

foo :: Coercible (a b) (c d) => a b -> c d
foo = undefined

I get

App.hs:5:8: error:
    Couldn't match representation of type ‘a b’ with that of ‘c d’
    Inaccessible code in
      the type signature for: foo :: Coercible (a b) (c d) => a b -> c d
    In the ambiguity check for the type signature for ‘foo’:
      foo :: forall (a :: * -> *) b (c :: * -> *) d.
             Coercible (a b) (c d) =>
             a b -> c d
    To defer the ambiguity check to use sites, enable AllowAmbiguousTypes
    In the type signature for ‘foo’:
      foo :: Coercible (a b) (c d) => a b -> c d

This is very silly, indeed.

Trac metadata
Trac field Value
Version 7.11
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information