[GHC] #15697: Typed holes inferring a more polymorphic type

GHC ghc-devs at haskell.org
Tue Oct 2 15:55:09 UTC 2018


#15697: Typed holes inferring a more polymorphic type
-------------------------------------+-------------------------------------
        Reporter:  sreenidhi         |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.6.1
       Component:  Compiler          |              Version:  8.6.1
      Resolution:                    |             Keywords:  TypedHoles
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by sreenidhi):

 I fully agree with your analysis about `testFailure` - for example I might
 want to write

 {{{#!hs

 test1 :: Char
 test1 =
   let x :: _  -- now x really has to be forall a. a -> a
       x = id
   in const (x 'c') (x 5)

 }}}

 But consider the following


 {{{#!hs
 test2 :: Char
 test2 =
   let x :: _    -- error: Found type wildcard ‘_’ standing for ‘Char’
       x = id 'c'
   in x

 test3 :: Char
 test3 =
   let x = id _ -- error: Found hole: _ :: a
   in x

 }}}

 Isn't it expected that the two errors to point to the same type?

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


More information about the ghc-tickets mailing list