[GHC] #9634: "data X = 1": "Illegal literal in type (use DataKinds to enable): 1"
#9634: "data X = 1": "Illegal literal in type (use DataKinds to enable): 1" -------------------------------------+------------------------------------- Reporter: rwbarton | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler (Type | Version: 7.9 checker) | Operating System: Keywords: | Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: Difficulty: Unknown | None/Unknown Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- This error message is not good. "1" is not in a type position, and DataKinds will not help anything. Well, except the error message, which with DataKinds enabled is instead {{{ parse error in constructor in data/newtype declaration: 1 }}} If it's not hard, we should give that error message also when DataKinds is disabled. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9634> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9634: "data X = 1": "Illegal literal in type (use DataKinds to enable): 1" -------------------------------------+------------------------------------- Reporter: rwbarton | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 7.9 (Type checker) | Keywords: Resolution: | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by Simon Peyton Jones <simonpj@…>): In [changeset:"ac157de3cd959a18a71fa056403675e2c0563497/ghc"]: {{{ #!CommitTicketReference repository="ghc" revision="ac157de3cd959a18a71fa056403675e2c0563497" Complain about illegal type literals in renamer, not parser A premature complaint was causing Trac #9634. Acutally this change also simplifies the lexer and eliminates duplication. (The renamer was already making the check, as it happens.) }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9634#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#9634: "data X = 1": "Illegal literal in type (use DataKinds to enable): 1" -------------------------------------+------------------------------------- Reporter: rwbarton | Owner: Type: bug | Status: closed Priority: low | Milestone: Component: Compiler | Version: 7.9 (Type checker) | Keywords: Resolution: fixed | Architecture: Unknown/Multiple Operating System: | Difficulty: Unknown Unknown/Multiple | Blocked By: Type of failure: | Related Tickets: None/Unknown | Test Case: | typecheck/should_fail/T9634 | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by simonpj): * status: new => closed * testcase: => typecheck/should_fail/T9634 * resolution: => fixed Comment: Good point, thank you. We now get {{{ T9634.hs:3:10: Cannot parse data constructor in a data/newtype declaration: 1 }}} whether or not `DataKinds` is on Simon -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/9634#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC