[GHC] #11016: PartialTypeSignatures trigger bogus "unbound implicit parameter" error

GHC ghc-devs at haskell.org
Tue Dec 1 22:52:18 UTC 2015


#11016: PartialTypeSignatures trigger bogus "unbound implicit parameter" error
-------------------------------------+-------------------------------------
        Reporter:  gridaphobe        |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.10.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #10846            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by gridaphobe):

 I see that commit 1e041b7 addresses this issue and fixes the 'unbound
 implicit parameter' error (thanks!!), but ghc still refuses to compile
 `f2`.

 {{{
 % ./inplace/bin/ghc-stage2 Bad.hs
 [1 of 1] Compiling Bad              ( Bad.hs, Bad.o )

 Bad.hs:9:1: error:
     • Could not deduce: ?loc::t
       from the context: ?loc::Int
         bound by the inferred type for ‘f2’:
                    (?loc::Int) => t
         at Bad.hs:9:1-9
     • When checking that the inferred type
         f2 :: forall t. (?loc::t) => t
       is as general as its (partial) signature
         f2 :: forall t. (?loc::Int) => t
 }}}

 I think this error is still bogus, because ghc should not have inferred

 {{{
         f2 :: forall t. (?loc::t) => t
 }}}

 in the first place. It should have inferred

 {{{
         f2 :: (?loc::Int) => Int
 }}}

 which is a valid instantiation of the partial signature, and so should be
 OK.

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


More information about the ghc-tickets mailing list