[GHC] #13834: Error cascade with type applications

GHC ghc-devs at haskell.org
Fri Feb 1 09:27:44 UTC 2019


#13834: Error cascade with type applications
-------------------------------------+-------------------------------------
        Reporter:  mpickering        |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
                                     |  TypeApplications, TypeErrorMessages
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #12794            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 Well

 * I think it'd be better to suppress the "Cannot apply" error. That is
 what the origina ticket Description was asking for, and I think I can see
 how to do so.  (Suppress the error in `TcExpr.tcArgs` if the `fun` is a
 `HsUnboundVar`.)

 * But a harder problem is that if you try with `-fdefer-type-errors` then
 we get
 {{{
 bash$ ghc -c T13834.hs -fdefer-type-errors

 T13834.hs:5:7: error:
     • Cannot apply expression of type ‘t1’
       to a visible type argument ‘Bool’
     • In the expression: notInScope @Bool
       In an equation for ‘foo’: foo = notInScope @Bool
   |
 5 | foo = notInScope @Bool
   |       ^^^^^^^^^^^^^^^^
 }}}
   The out-of-scope thing has turned into a warning, with deferred
 evidence.  And rightly so in a way: you can run a program with an out-of-
 scope variable, provided you don't evaluate it.   But the "cannot apply"
 error is still an error: it can't be deferred.

   I have not thought deeply about this, but I can't see an easy fix.

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


More information about the ghc-tickets mailing list