[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 <ryan.gl.scott@…>): In [changeset:"79c641de60f1d6aa6f724d4fc49137ccbe3ab008/ghc" 79c641d/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="79c641de60f1d6aa6f724d4fc49137ccbe3ab008" Fix #15781 by using ktypedocs on type synonym RHSes Summary: This is a follow-up to D5173, which permitted unparenthesized kind signatures in certain places. One place that appeared to be overlooked was the right-hand sides of type synonyms, which this patch addresses by introducing a `ktypedoc` parser production (which is to `ctypdoc` as `ktype` is to `ctype`) and using it in the right place. Test Plan: make test TEST="KindSigs T15781" Reviewers: harpocrates, bgamari Reviewed By: harpocrates Subscribers: rwbarton, mpickering, carter GHC Trac Issues: #15781 Differential Revision: https://phabricator.haskell.org/D5245 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15781#comment:2> 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: 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