[GHC] #11540: ghc accepts non-standard type without language extension

#11540: ghc accepts non-standard type without language extension -------------------------------------+------------------------------------- Reporter: augustss | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 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: -------------------------------------+------------------------------------- Ghc accepts this {{{ f :: Eq a => Eq b => a -> b -> Bool f a b = a==a && b==b }}} The nested contexts should require some language extension. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11540 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11540: ghc accepts non-standard type without language extension -------------------------------------+------------------------------------- Reporter: augustss | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 (Parser) | 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: | -------------------------------------+------------------------------------- Changes (by bgamari): * component: Compiler => Compiler (Parser) Comment: Hmmm, fair enough. Perhaps `-XNestedContexts`? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11540#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11540: ghc accepts non-standard type without language extension -------------------------------------+------------------------------------- Reporter: augustss | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 (Parser) | 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 rwbarton): If we want to control this with a language extension, then `Rank2Types`/`RankNTypes` should be a good choice. After all we already have {{{ Prelude> let f :: a -> Eq a => a; f = undefined <interactive>:4:10: Illegal polymorphic or qualified type: Eq a => a Perhaps you intended to use RankNTypes or Rank2Types In the type signature for âfâ: f :: a -> Eq a => a }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11540#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11540: ghc accepts non-standard type without language extension -------------------------------------+------------------------------------- Reporter: augustss | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 (Parser) | 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 bgamari): That being said, it was decided at some point that we should also allow `foralls` independently from `RankNTypes` with `ExplicitForAlls`. My initial thought was that `RankNTypes` would imply `NestedContexts`, just as it does `ExplicitForAlls`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11540#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11540: ghc accepts non-standard type without language extension -------------------------------------+------------------------------------- Reporter: augustss | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 (Parser) | 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 simonpj): I'd be happy to see this checked, if someone wants to have a go, but I doubt that it's a very high priority. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11540#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11540: ghc accepts non-standard type without language extension -------------------------------------+------------------------------------- Reporter: augustss | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 (Parser) | 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 simonpj): Moreover, the current treatment (allowing nested contexts) is inconsistent with GADTs (#12087), which is undesirable. Nothing hard here; just gotta decide what we want and implement it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11540#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11540: ghc accepts non-standard type without language extension -------------------------------------+------------------------------------- Reporter: augustss | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #5957 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * related: => #5957 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11540#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC