[GHC] #12529: Error message: visible type application of constructor/variable that is not in scope
#12529: Error message: visible type application of constructor/variable that is not in scope -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple TypeApplications | Architecture: | Type of failure: Incorrect Unknown/Multiple | warning at compile-time Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- If I use an identifier not in scope: {{{ $ ghci -ignore-dot-ghci GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help Prelude> p <interactive>:1:1: error: Variable not in scope: p Prelude> P <interactive>:2:1: error: Data constructor not in scope: P }}} Using visible type application: {{{ $ ghci -ignore-dot-ghci -XTypeApplications GHCi, version 8.0.1: http://www.haskell.org/ghc/ :? for help Prelude> p @Int <interactive>:1:1: error: • Cannot apply expression of type ‘t0’ to a visible type argument ‘Int’ • In the expression: p @Int In an equation for ‘it’: it = p @Int Prelude> P @Int <interactive>:2:1: error: • Cannot apply expression of type ‘t0’ to a visible type argument ‘Int’ • In the expression: P @Int In an equation for ‘it’: it = P @Int }}} I would prefer these error messages to be the same as the first two: thoughts? -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12529> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12529: Error message: visible type application of constructor/variable that is not in scope -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Iceland_jack): This gave me pause when I thought `Proxy` was in scope and tried applying to to a type variable `Proxy @s` -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12529#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12529: Error message: visible type application of constructor/variable that is not in scope -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): The fact that GHC treats out-of-scope errors as type errors causes degradation of certain error messages, like what you see here. I'm sure there's another ticket tracking this problem, but I'm unable to find it at the moment. Perhaps you can? If I recall, the original error message was about a lack of class instances. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12529#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12529: Error message: visible type application of constructor/variable that is not in scope -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by simonpj): It's #12170 I think. Ben, I think that patch (for #12170) is ready to go. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12529#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12529: Error message: visible type application of constructor/variable that is not in scope -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by goldfire): I'm afraid I wasn't referring to #12170, which is concerned with the interaction between `-fdefer-type-errors` and the new treatment of out-of- scope variables. The bug reported here triggers without `-fdefer-type- errors`. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12529#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12529: Error message: visible type application of constructor/variable that is not in scope -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by lexi.lambda): I recently ran into this, too. It’s definitely extremely confusing, since usually identifiers that aren’t in scope are ''very'' clearly indicated in error messages, but nothing in these errors would suggest that’s the problem. It took me a while to realize what exactly the problem was. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12529#comment:5> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12529: Error message: visible type application of constructor/variable that is not in scope -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"2fdf21bf26386ac5558ed5b95105bcf78e31f093/ghc" 2fdf21b/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="2fdf21bf26386ac5558ed5b95105bcf78e31f093" Further improve error handling in TcRn monad This patch builds on the one for Trac #12124, by dealing properly with out-of-scope "hole" errors. This fixes Trac #12529. The hard error coming from visible type application is still there, but the out-of-scope error is no longer suppressed. (Arguably the VTA message should be suppressed somehow, but that's a battle for another day.) }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12529#comment:6> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12529: Error message: visible type application of constructor/variable that is not in scope -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: merge Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 Resolution: | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Incorrect | Test Case: warning at compile-time | typecheck/should_fail/T12529 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * testcase: => typecheck/should_fail/T12529 * status: new => merge Comment: Possibly worth merging? Since the patch for #12124 is. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12529#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#12529: Error message: visible type application of constructor/variable that is not in scope -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1 Resolution: fixed | Keywords: | TypeApplications Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Incorrect | Test Case: warning at compile-time | typecheck/should_fail/T12529 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed * milestone: => 8.0.2 Comment: Merged to `ghc-8.0` as 1ef274298978369e2e07b5c43e635a5ca529a0af. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12529#comment:8> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC