Skip to content

Associated Type Synonyms do not unfold in InstanceSigs

{-# LANGUAGE InstanceSigs, TypeFamilies #-}

class C a where
  type T a
  m :: T a

instance C Int where
  type T Int = String
  m :: String
  m = "bla"

-- Method signature does not match class; it should be m :: T Int
--    In the instance declaration for ‘C Int’

As T Int is a synonym of String, m :: String should be a valid type signature alternative to m :: T Int

Trac metadata
Trac field Value
Version 7.8.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
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