[GHC] #10719: Malformed data type quotation accepted

GHC ghc-devs at haskell.org
Sat Aug 1 00:06:42 UTC 2015


#10719: Malformed data type quotation accepted
-------------------------------------+-------------------------------------
        Reporter:  heisenbug         |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.8.3
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by heisenbug):

 I should add that `:set -XDataKinds` and `:set -XTemplateHaskell` are on.

 I have played around a bit and these are actually accepted

 Prelude Language.Haskell.TH> {{{$(stringE . show =<< [d| type C = A; data
 A x where C :: 'C Int |])}}}

 "[TySynD C_1627404906 [] (ConT A_1627404904),DataD [] A_1627404904
 [PlainTV x_1627404907] [ForallC [] [AppT (AppT EqualityT (VarT
 x_1627404907)) (ConT GHC.Types.Int)] (NormalC C_1627404905 [])] []]"

 Prelude Language.Haskell.TH> {{{$(stringE . show =<< [d| data A x where C
 :: 'C Int |])}}}

 "[DataD [] A_1627405048 [PlainTV x_1627405050] [ForallC [] [AppT (AppT
 EqualityT (VarT x_1627405050)) (ConT GHC.Types.Int)] (NormalC C_1627405049
 [])] []]"

 with both `DataKinds` and `NoDataKinds`. All is very suspicipus, I think
 the result type's head is never checked.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10719#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list