[GHC] #15781: Extraneous parentheses required to parse kind signature on the RHS of a type synonym

#15781: Extraneous parentheses required to parse kind signature on the RHS of a type synonym -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.7 (Parser) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: GHC rejects Unknown/Multiple | valid program Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- After Phab:D5173, the restrictions about where kind signatures can appear in the source were significantly relaxed so that things like: {{{#!hs type family F where F = Int :: Type }}} Are now allowed. However, there appears to be one case that was missed in that patch: the right-hand sides of type synonyms. For instance, I would expect the following to parse: {{{#!hs {-# LANGUAGE KindSignatures #-} module Bug where import Data.Kind type F = Int :: Type }}} However, even GHC HEAD still refuses to parse this: {{{ $ /opt/ghc/head/bin/ghci Bug.hs GHCi, version 8.7.20181015: http://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /home/rgscott/.ghci [1 of 1] Compiling Bug ( Bug.hs, interpreted ) Bug.hs:6:14: error: parse error on input ‘::’ | 6 | type F = Int :: Type | ^^ }}} Luckily, I don't think this will be too difficult to fix, since all that needs to be done is to update the parser production for type synonyms to use something like `ktype` instead of `ctype`. Patch incoming. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15781 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15781: Extraneous parentheses required to parse kind signature on the RHS of a type synonym -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.7 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: GHC rejects | Unknown/Multiple valid program | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5245 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => patch * differential: => Phab:D5245 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15781#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15781: Extraneous parentheses required to parse kind signature on the RHS of a
type synonym
-------------------------------------+-------------------------------------
Reporter: RyanGlScott | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone: 8.8.1
Component: Compiler | Version: 8.7
(Parser) |
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
Type of failure: GHC rejects | Unknown/Multiple
valid program | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D5245
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ryan Scott

#15781: Extraneous parentheses required to parse kind signature on the RHS of a type synonym -------------------------------------+------------------------------------- Reporter: RyanGlScott | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 8.7 (Parser) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: GHC rejects | Test Case: valid program | parser/should_compile/T15781 Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D5245 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: patch => closed * testcase: => parser/should_compile/T15781 * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15781#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC