[GHC] #11941: stage restriction mentioned when an identifier is out of scope

#11941: stage restriction mentioned when an identifier is out of scope -------------------------------------+------------------------------------- Reporter: aavogt | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1-rc2 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: -------------------------------------+------------------------------------- {{{#!hs {-# LANGUAGE TemplateHaskell #-} import Data.Monoid const (return []) $ mempty { getFrst = Just () } }}} {{{ typeErrBug.hs:5:21: error: • GHC stage restriction: ‘getFrst’ is used in a top-level splice, quasi-quote, or annotation, and must be imported, not defined locally • In the second argument of ‘($)’, namely ‘mempty {getFrst = Just ()}’ In the expression: const (return []) $ mempty {getFrst = Just ()} typeErrBug.hs:5:30: error: Not in scope: ‘getFrst’ Perhaps you meant one of these: ‘getFirst’ (imported from Data.Monoid), ‘getLast’ (imported from Data.Monoid) }}} The stage restriction error shouldn't be mentioned: `getFrst` isn't defined at all while the "not defined locally" phrase says it's defined (in the wrong spot). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11941 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11941: stage restriction mentioned when an identifier is out of scope
-------------------------------------+-------------------------------------
Reporter: aavogt | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 8.0.1-rc2
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 Simon Peyton Jones

#11941: stage restriction mentioned when an identifier is out of scope -------------------------------------+------------------------------------- Reporter: aavogt | Owner: Type: bug | Status: merge Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1-rc2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: th/T11941 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => merge * testcase: => th/T11941 * milestone: => 8.0.2 Comment: Great error report, thank you. The fix is small and non-invasive, so I'll mark it as "merge". Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11941#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11941: stage restriction mentioned when an identifier is out of scope -------------------------------------+------------------------------------- Reporter: aavogt | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: Compiler | Version: 8.0.1-rc2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: th/T11941 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-8.0` as 8405c2edddd0cc76c748b109d99f096c33d1dc50. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11941#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC