[GHC] #16115: Missing associated type instance not reported with error

GHC ghc-devs at haskell.org
Wed Jan 9 01:45:17 UTC 2019


#16115: Missing associated type instance not reported with error
-------------------------------------+-------------------------------------
        Reporter:  dfeuer            |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.10.1
       Component:  Compiler (Type    |              Version:  8.6.3
  checker)                           |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Poor/confusing    |  Unknown/Multiple
  error message                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by dfeuer):

 I think there's a much more conservative option that would be much better.
 When we come down to wanting `Item Nat ~ ()`, the type checker ''knows''
 that `Item Nat` is a stuck type, and it ''knows'' that `()` is not the
 same stuck type. So the problem can immediately be narrowed down to

 {{{
 Could not match expected type `Item Nat' with actual type `()'.
 The type family application `Item Nat' is stuck. [etc.]
 }}}

 We presumably ''also'' know that `Item` is an associated type of
 `FromList`, so we should be able to do a bit better, incorporating the
 information from the suppressed warning:

 {{{
 Could not match expected type `Item Nat' with actual type `()'.
 No explicit associated type or default declaration for ‘Item’
 in the instance declaration for ‘FromList Nat’
 [etc.]
 }}}

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16115#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list