[GHC] #10719: Malformed data type quotation accepted
GHC
ghc-devs at haskell.org
Fri Jan 8 11:02:11 UTC 2016
#10719: Malformed data type quotation accepted
-------------------------------------+-------------------------------------
Reporter: heisenbug | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Template Haskell | 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: #11341 | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Changes (by jstolarek):
* related: => #11341
Comment:
Representation of GADTs has changed (#11341) since this was reported. Now
we get:
{{{
ghci> $(stringE . show =<< [d| data A where C :: C |])
"[DataD [] A_1627425412 [] Nothing
[GadtC [C_1627425413] [] (PromotedT C_1627425413)] []]"
ghci> $(stringE . show =<< [d| data A p where C :: C |])
"[DataD [] A_1627426432 [PlainTV p_1627426434] Nothing
[GadtC [C_1627426433] [] (PromotedT C_1627426433)] []]"
ghci> $(stringE . show =<< [d| type C = A; data A x where C :: 'C Int |])
"[ TySynD C_1627426587 [] (ConT A_1627426585)
, DataD [] A_1627426585 [PlainTV x_1627426588] Nothing
[GadtC [C_1627426586] [] (AppT (PromotedT C_1627426586)
(ConT GHC.Types.Int))] []]"
ghci> $(stringE . show =<< [d| data A x where C :: 'C Int |])
"[DataD [] A_1627426731 [PlainTV x_1627426733] Nothing
[GadtC [C_1627426732] [] (AppT (PromotedT C_1627426732)
(ConT GHC.Types.Int))] []]"
}}}
I believe that quoting works correctly here. Note also that all four
definitions are invalid and they are correctly rejected by HEAD if you
quote them and splice them in immediately. (Also, (3) and (4) are
semantically equivalent since the type synonym is not used in any way.)
This definition is also rejected by HEAD:
{{{#!hs
data A p where
C :: (A p ~ C) => C
}}}
Unless I am missing something, I would close this report as invalid.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10719#comment:6>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list