[GHC] #9436: Confusing error message with RecordWildCards

#9436: Confusing error message with RecordWildCards -------------------------------------+------------------------------------- Reporter: elliottt | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Keywords: | Operating System: Architecture: Unknown/Multiple | Unknown/Multiple Difficulty: Unknown | Type of failure: Blocked By: | None/Unknown Related Tickets: | Test Case: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- When using the RecordWildCards extension, a confusing error message is given when the constructor name is invalid. For example, this module: {{{ {-# LANGUAGE RecordWildCards #-} module Test where data T = T { x :: Int } f :: T -> Int f T' { .. } = x + 1 }}} yields two error messages. The first is about the constructor T' not being in scope, and the second is a confusing message about how `..' is not valid in a record pattern: {{{ GHCi, version 7.8.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... linking ... done. [1 of 1] Compiling Test ( Test.hs, interpreted ) Test.hs:8:3: Not in scope: data constructor ‘T'’ Perhaps you meant ‘T’ (line 5) Test.hs:8:3: You cannot use `..' in a record pattern Failed, modules loaded: none. }}} It seems like the second error should be left out in this case, as it's enough to report that the name isn't in scope. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9436 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9436: Confusing error message with RecordWildCards
-------------------------------------+-------------------------------------
Reporter: elliottt | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.3
Resolution: | Keywords:
Operating System: | Architecture: Unknown/Multiple
Unknown/Multiple | Difficulty: Unknown
Type of failure: | Blocked By:
None/Unknown | Related Tickets:
Test Case: |
Blocking: |
Differential Revisions: |
-------------------------------------+-------------------------------------
Comment (by Simon Peyton Jones

#9436: Confusing error message with RecordWildCards -------------------------------------+------------------------------------- Reporter: elliottt | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | rename/should_fail/T9436 | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by simonpj): * testcase: => rename/should_fail/T9436 Comment: Thanks for reporting this. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9436#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#9436: Confusing error message with RecordWildCards -------------------------------------+------------------------------------- Reporter: elliottt | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.8.3 Resolution: fixed | Keywords: Operating System: | Architecture: Unknown/Multiple Unknown/Multiple | Difficulty: Unknown Type of failure: | Blocked By: None/Unknown | Related Tickets: Test Case: | rename/should_fail/T9436 | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9436#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC