[GHC] #13834: Error cascade with type applications

GHC ghc-devs at haskell.org
Fri Jun 16 16:01:38 UTC 2017


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

 {{{
 foo = notInScope @Bool
 }}}

 Leads to the right out of scope error but also an error about using type
 application when `notInScope` is
 not a polytype. I think the second error should be suppressed.

 {{{
 t.hs:4:7: error: Variable not in scope: notInScope
   |
 4 | foo = notInScope @Bool
   |       ^^^^^^^^^^

 t.hs:4:7: error:
     • Cannot apply expression of type ‘t1’
       to a visible type argument ‘Bool’ notInScope
     • In the expression: notInScope @Bool
       In an equation for ‘foo’: foo = notInScope @Bool
   |
 4 | foo = notInScope @Bool
   |       ^^^^^^^^^^^^^^^^
 }}}

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


More information about the ghc-tickets mailing list