[GHC] #8708: Kind annotation in tuple not parsed

#8708: Kind annotation in tuple not parsed -------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler (Parser) | Version: 7.7 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | -------------------------------------+------------------------------------- Consider this: {{{ {-# LANGUAGE KindSignatures #-} foo :: (Int, Int :: *) foo = undefined }}} HEAD reports {{{ /Users/rae/temp/Bug.hs:5:18: parse error on input ‛::’ }}} Changing the line to {{{ foo :: (Int, (Int :: *)) }}} fixes the problem. Note the extra parentheses. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8708 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8708: Kind annotation in tuple not parsed -------------------------------------+------------------------------------- Reporter: goldfire | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 (Parser) | Keywords: Resolution: | Architecture: Operating System: Unknown/Multiple | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by thomie): What about the following: * unboxed tuples: `(# Int, Int :: * #)` * lists: `[ Int :: * ]` * parallel arrays: `[: Int :: * :]` * default declarations: `default ( Int :: * )` Currently all of those don't allow types with kind annotation but without parenthesis. They only allow `ctype`s: {{{ -- A ctype is a for-all type ctype :: { RdrNameHsType } : 'forall' tv_bndrs '.' ctype { mkHsForAllTy (Just $2) [] $4 } | context '=>' type { mkHsForAllTy Nothing $1 $3 } -- A type of form (context => type) is an *implicit* HsForAllTy | type { $1 } }}} Implementation wise it would be nice to keep doing the same for all: either allow kind annotation without parenthesis, or keep the status quo (since 2002). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8708#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8708: Kind annotation in tuple not parsed -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.7 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11267, #11622 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * related: => #11267, #11622 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8708#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8708: Kind annotation in tuple not parsed -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: Component: Compiler | Version: 7.7 (Parser) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: #11267, #11622 | Differential Rev(s): Phab:D5173 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: new => patch * differential: => Phab:D5173 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8708#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8708: Kind annotation in tuple not parsed
-------------------------------------+-------------------------------------
Reporter: goldfire | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone:
Component: Compiler | Version: 7.7
(Parser) |
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #11267, #11622 | Differential Rev(s): Phab:D5173
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ryan Scott

#8708: Kind annotation in tuple not parsed -------------------------------------+------------------------------------- Reporter: goldfire | Owner: (none) Type: bug | Status: closed Priority: normal | Milestone: 8.8.1 Component: Compiler | Version: 7.7 (Parser) | Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: | parser/should_compile/T8708 Blocked By: | Blocking: Related Tickets: #11267, #11622 | Differential Rev(s): Phab:D5173 Wiki Page: | -------------------------------------+------------------------------------- Changes (by RyanGlScott): * status: patch => closed * testcase: => parser/should_compile/T8708 * resolution: => fixed * milestone: => 8.8.1 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8708#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC