[GHC] #11669: Incorrectly suggests RankNTypes for ill-formed type "forall a. Eq a. Int"

#11669: Incorrectly suggests RankNTypes for ill-formed type "forall a. Eq a. Int" -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 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: -------------------------------------+------------------------------------- {{{ baldur@Loki:~$ ghci -ignore-dot-ghci GHCi, version 8.1.20160117: http://www.haskell.org/ghc/ :? for help Prelude> let foo :: forall a. Eq a. Int; foo = undefined <interactive>:1:20: error: Illegal symbol '.' in type Perhaps you intended to use RankNTypes or a similar language extension to enable explicit-forall syntax: forall <tvs>. <type> Prelude> :set -XRankNTypes Prelude> let foo :: forall a. Eq a. Int; foo = undefined <interactive>:3:26: error: Illegal symbol '.' in type Perhaps you intended to use RankNTypes or a similar language extension to enable explicit-forall syntax: forall <tvs>. <type> Prelude> }}} also {{{ Prelude> :kind forall a. Eq a. Int <interactive>:1:15: error: Illegal symbol '.' in type Perhaps you intended to use RankNTypes or a similar language extension to enable explicit-forall syntax: forall <tvs>. <type> }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11669 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11669: Incorrectly suggests RankNTypes for ill-formed type "forall a. Eq a. Int" -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 (Parser) | Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #3155 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by thomie): * keywords: => newcomer * failure: None/Unknown => Incorrect warning at compile-time * component: Compiler => Compiler (Parser) * related: => #3155 Comment: This could be easy to fix: * Suggest `ExplicitForAll` instead of `RankNTypes`. * Only suggest `ExplicitForAll` if `ExplicitForAll` isn't set yet. For a newcomer: the code is `compiler/parser/Parser.y`. Search for `RankNTypes`, and see the function `hintExplicitForall` for inspiration. Don't forget a test! The last real change to this code was in 6c06fdc7ad20682f0f52b5a78e5e3487a2ed047b (#3155). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11669#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11669: Incorrectly suggests RankNTypes for ill-formed type "forall a. Eq a. Int" -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 (Parser) | Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #3155 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by jstolarek): Thomie, I am a bit puzzled by your comment. I think that the signature `foo :: forall a. Eq a. Int` is incorrect (even with `ExplicitForAll` or `RankNTypes`) and should be simply rejected with a parse error. Or am I missing something? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11669#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11669: Incorrectly suggests RankNTypes for ill-formed type "forall a. Eq a. Int" -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 (Parser) | Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #3155 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by drobnik): * cc: drobnik (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11669#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11669: Incorrectly suggests RankNTypes for ill-formed type "forall a. Eq a. Int" -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 (Parser) | Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #3155 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by jstolarek): * cc: jstolarek (added) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11669#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11669: Incorrectly suggests RankNTypes for ill-formed type "forall a. Eq a. Int" -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: drobnik Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 (Parser) | Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #3155 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by drobnik): * owner: => drobnik -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11669#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11669: Incorrectly suggests RankNTypes for ill-formed type "forall a. Eq a. Int" -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: drobnik Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.1 (Parser) | Resolution: | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #3155, #12811 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * cc: RyanGlScott (added) * related: #3155 => #3155, #12811 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11669#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11669: Incorrectly suggests RankNTypes for ill-formed type "forall a. Eq a. Int" -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: drobnik Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 (Parser) | Resolution: duplicate | Keywords: newcomer Operating System: Unknown/Multiple | Architecture: Type of failure: Incorrect | Unknown/Multiple warning at compile-time | Test Case: Blocked By: | Blocking: Related Tickets: #3155, #12811 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => closed * resolution: => duplicate * milestone: => 8.2.1 Comment: This was fixed in commit 488a9daa8246e0dd364dc44b8b6b8650fa6f3822 (Changed parser message for RankNTypes (#12811)), so I'll close this as a duplicate. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11669#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC