#16375: TypeApplications obscure "Variable not in scope" error message

"GHC" <[email protected]>
Newsgroups gmane.comp.lang.haskell.glasgow.bugs
Message-ID <[email protected]>
#16375: TypeApplications obscure "Variable not in scope" error message
-------------------------------------+-------------------------------------
           Reporter:  roland         |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.6.3
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Compiling

 {{{#!hs
 {-# LANGUAGE TypeApplications #-}

 module Foo where

 foo = bar @Int
 }}}

 gives

 {{{
 Foo.hs:5:7: error:
     • Cannot apply expression of type ‘t1’
       to a visible type argument ‘Int’
     • In the expression: bar @Int
       In an equation for ‘foo’: foo = bar @Int
 }}}

 instead of:
 {{{
 Foo.hs:5:7: error: Variable not in scope: bar
 }}}

 This makes a potential typo appear like a typing error (no pun intended).
 If we delete `@Int`, the second message is given.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/16375>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.