GHC issueshttps://gitlab.haskell.org/ghc/ghc/-/issues2020-12-02T21:56:59Zhttps://gitlab.haskell.org/ghc/ghc/-/issues/9582Associated Type Synonyms do not unfold in InstanceSigs2020-12-02T21:56:59Zandreas.abelAssociated Type Synonyms do not unfold in InstanceSigs```hs
{-# 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 th...```hs
{-# 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`
<details><summary>Trac metadata</summary>
| 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 | |
</details>
<!-- {"blocked_by":[],"summary":"Associated Type Synonyms do not unfold in InstanceSigs","status":"New","operating_system":"","component":"Compiler (Type checker)","related":[],"milestone":"","resolution":"Unresolved","owner":{"tag":"Unowned"},"version":"7.8.3","keywords":["InstanceSigs","TypeFamilies"],"differentials":[],"test_case":"","architecture":"","cc":[""],"type":"Bug","description":"{{{#!hs\r\n{-# LANGUAGE InstanceSigs, TypeFamilies #-}\r\n\r\nclass C a where\r\n type T a\r\n m :: T a\r\n\r\ninstance C Int where\r\n type T Int = String\r\n m :: String\r\n m = \"bla\"\r\n\r\n-- Method signature does not match class; it should be m :: T Int\r\n-- In the instance declaration for ‘C Int’\r\n}}}\r\n\r\nAs {{{T Int}}} is a synonym of {{{String}}}, {{{m :: String}}} should be a valid type signature alternative to {{{m :: T Int}}}","type_of_failure":"OtherFailure","blocking":[]} -->7.10.1