[GHC] #8306: NegativeLiterals allows negative type-level integers
#8306: NegativeLiterals allows negative type-level integers -------------------------------------+------------------------------------- Reporter: monoidal | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: GHC accepts Difficulty: Easy (less than 1 | invalid program hour) | Test Case: Blocked By: | Blocking: Related Tickets: | -------------------------------------+------------------------------------- With NegativeLiterals extension it is possible to write negative type- level "naturals" {{{ type T = -1 }}} while the current solver assumes everything is nonnegative and claims 0 <= -1. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8306> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8306: NegativeLiterals allows negative type-level integers -------------------------------------+------------------------------------- Reporter: monoidal | Owner: thoughtpolice Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: GHC accepts | Difficulty: Easy (less than 1 invalid program | hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Changes (by thoughtpolice): * owner: => thoughtpolice Comment: Great catch. I have a fix I'm validating as we speak... -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8306#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8306: NegativeLiterals allows negative type-level integers -------------------------------------+------------------------------------- Reporter: monoidal | Owner: thoughtpolice Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: GHC accepts | Difficulty: Easy (less than 1 invalid program | hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Comment (by Austin Seipp <austin@…>): In [changeset:3ee47002dd483e0daa604d37ec45dc33133ff04b/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="3ee47002dd483e0daa604d37ec45dc33133ff04b" Make sure type literals aren't negative (#8306) As Krzysztof pointed out in #8306, with NegativeLiterals and DataKinds, definitions such as: type T = -1 were accepted, although type literals must be greater than zero. Signed-off-by: Austin Seipp <austin@well-typed.com> }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8306#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8306: NegativeLiterals allows negative type-level integers -------------------------------------+------------------------------------- Reporter: monoidal | Owner: thoughtpolice Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: GHC accepts | Difficulty: Easy (less than 1 invalid program | hour) Test Case: | Blocked By: Blocking: | Related Tickets: -------------------------------------+------------------------------------- Comment (by Austin Seipp <austin@…>): In [changeset:32e9017d87792455e15ce1cb232c8c9b4b20cede/testsuite]: {{{ #!CommitTicketReference repository="testsuite" revision="32e9017d87792455e15ce1cb232c8c9b4b20cede" Test for #8306 Signed-off-by: Austin Seipp <austin@well-typed.com> }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8306#comment:3> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#8306: NegativeLiterals allows negative type-level integers -------------------------------------+------------------------------------- Reporter: monoidal | Owner: thoughtpolice Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.7 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: GHC accepts | Difficulty: Easy (less than 1 invalid program | hour) Test Case: | Blocked By: tests/typecheck/should_fail/T8306.hs| Related Tickets: Blocking: | -------------------------------------+------------------------------------- Changes (by thoughtpolice): * status: new => closed * testcase: => tests/typecheck/should_fail/T8306.hs * resolution: => fixed -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8306#comment:4> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC