[GHC] #12589: GHC panic with defer-typed-holes

GHC ghc-devs at haskell.org
Sun Sep 18 15:09:10 UTC 2016


#12589: GHC panic with defer-typed-holes
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
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 simonpj):

 Hmm.  In HEAD (and therefore I think 8.0 but I'm not certain) an out-of-
 scope variable is an error, so we get
 {{{
 T12589.hs:11:14: error: Variable not in scope: (&) :: t0 -> t1 -> t
 }}}
 regardless of `-fefer-typed-holes`.  If I change it to be
 {{{
 a = _foo minBound (hcpure (Proxy @Bounded))
 }}}
 using a named wildcard, with `-defer-typed-holes` in HEAD I get
 {{{
 s:12:5: warning: [-Wtyped-holes]
     * Found hole: _foo :: t0 -> t1 -> t
       Where: `t0' is an ambiguous type variable
              `t1' is an ambiguous type variable
              `t' is a rigid type variable bound by
                the inferred type of a :: t at T12589.hs:12:1-43
       Or perhaps `_foo' is mis-spelled, or not in scope
     * In the expression: _foo
       In the expression: _foo minBound (hcpure (Proxy @Bounded))
       In an equation for `a': a = _foo minBound (hcpure (Proxy @Bounded))
     * Relevant bindings include a :: t (bound at T12589.hs:12:1)

 T12589.hs:12:20: warning: [-Wdeferred-type-errors]
     * Cannot instantiate unification variable `t1'
       with a type involving foralls:
         (forall a. Bounded a => f0 a) -> h0 f0 xs0
         GHC doesn't yet support impredicative polymorphism
     * In the second argument of `_foo', namely
         `(hcpure (Proxy @Bounded))'
       In the expression: _foo minBound (hcpure (Proxy @Bounded))
       In an equation for `a': a = _foo minBound (hcpure (Proxy @Bounded))
 }}}
 which is what I'd expect.

 I have not investigated the "falling ito a hole" error becuase it just
 doesn't happen in HEAD.

 So could someone test with 8.0.1?  If it's ok there then let's just add a
 regression test and declare it fixed.

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


More information about the ghc-tickets mailing list