[GHC] #10719: Malformed data type quotation accepted
GHC
ghc-devs at haskell.org
Fri Jul 31 23:41:48 UTC 2015
#10719: Malformed data type quotation accepted
-------------------------------------+-------------------------------------
Reporter: heisenbug | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.8.3
Keywords: | Operating System: Unknown/Multiple
Architecture: | Type of failure: None/Unknown
Unknown/Multiple |
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Revisions: |
-------------------------------------+-------------------------------------
This is accepted:
Prelude Language.Haskell.TH> {{{$(stringE . show =<< [d| data A where C ::
C |])}}}
"[DataD [] A_1627402878 [] [ForallC [] [] (NormalC C_1627402879 [])] []]"
In contrast this is rejected:
Prelude Language.Haskell.TH> {{{$(stringE . show =<< [d| data A p where C
:: C |])}}}
<interactive>:29:22: Malformed constructor result type: C
However it would make sense to form an equality constraint (for later
kind/type checking) in these cases, something along the lines of:
{{{#!hs
data A p where
C :: (A p ~ C) => C
}}}
as there could be type synonym (or family) `C`.
I have tested various versions >= 7.8.3 and all seem to behave the same.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10719>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list