reify returns Dec that use ConT instead of PromotedT
Trac metadata
Trac field | Value |
---|---|
Version | 7.10.2 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | Template Haskell |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | |
Operating system | |
Architecture |
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
- Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Link issues together to show that they're related or that one is blocking others.
Learn more.
Activity
-
Newest first Oldest first
-
Show all activity Show comments only Show history only
- aavogt changed weight to 5
changed weight to 5
- aavogt added Tbug TemplateHaskell Trac import labels
added Tbug TemplateHaskell Trac import labels
- Author
Attached file
C.hs
($1178). - Author
Attached file
Main.hs
($1179). - Author
running Main.hs leads to output:
reify uses ConT True AppT (ConT C.C) (ConT GHC.Types.False) AppT (ConT C.C) (ConT GHC.Types.True) oxford brackets use PromotedT AppT (ConT C.C) (PromotedT GHC.Types.True)
The output should be:
reify uses ConT True AppT (ConT C.C) (PromotedT GHC.Types.False) AppT (ConT C.C) (PromotedT GHC.Types.True) oxford brackets use PromotedT AppT (ConT C.C) (PromotedT GHC.Types.True)
- Ben Gamari changed milestone to %8.0.2
changed milestone to %8.0.2
- Maintainer
Hmm, this is still reproducible on a recent GHC 8.0 snapshot.
Also with promoted tuples, quotation using quotation brackets
[t| .. |]
yields a different promoted type than the type obtained byreify
. Consider:{-# LANGUAGE FlexibleInstances, KindSignatures, TemplateHaskell, DataKinds #-} module MoreBugs where import Language.Haskell.TH class D (a :: (Bool, Bool)) instance D '(True, False) $(return []) main = do putStrLn $ $([t| D '(True, False) |] >>= stringE . show) putStrLn "vs." putStrLn $ $(do ClassI _ [InstanceD _ ty _] <- reify ''D stringE (show ty))
On a recent GHC snapshot this gives:
AppT (ConT MoreBugs.D) (AppT (AppT (PromotedTupleT 2) (PromotedT GHC.Types.True)) (PromotedT GHC.Types.False)) vs. AppT (ConT MoreBugs.D) (SigT (AppT (AppT (ConT GHC.Tuple.(,)) (ConT GHC.Types.True)) (ConT GHC.Types.False)) (AppT (AppT (TupleT 2) (ConT GHC.Types.Bool)) (ConT GHC.Types.Bool)))
I've submitted a preliminary patch fixing the bug mentioned by @aavogt's . However, the inconsistencies wrt promoted tuples remain. See the phabricator diff for the remaining problems.
Trac metadata
Trac field Value Differential revisions - → D2188 - Ben Gamari changed milestone to %8.2.1
changed milestone to %8.2.1
- Maintainer
Bumping off to 8.2.1.
- erikd mentioned in issue #12853 (closed)
mentioned in issue #12853 (closed)
- Ben Gamari closed
closed
- Maintainer
Trac metadata
Trac field Value Resolution Unresolved → ResolvedFixed - Ben Gamari added Pnormal label
added Pnormal label
Please register or sign in to reply