[GHC] #11629: reify returns Dec that use ConT instead of PromotedT

#11629: reify returns Dec that use ConT instead of PromotedT -------------------------------------+------------------------------------- Reporter: aavogt | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Template | Version: 7.10.2 Haskell | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11629 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11629: reify returns Dec that use ConT instead of PromotedT -------------------------------------+------------------------------------- Reporter: aavogt | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by aavogt): * Attachment "C.hs" added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11629 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11629: reify returns Dec that use ConT instead of PromotedT -------------------------------------+------------------------------------- Reporter: aavogt | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by aavogt): * Attachment "Main.hs" added. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11629 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11629: reify returns Dec that use ConT instead of PromotedT -------------------------------------+------------------------------------- Reporter: aavogt | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Template Haskell | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by aavogt): 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) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11629#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11629: reify returns Dec that use ConT instead of PromotedT -------------------------------------+------------------------------------- Reporter: aavogt | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Template Haskell | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: => 8.0.2 Comment: Hmm, this is still reproducible on a recent GHC 8.0 snapshot. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11629#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11629: reify returns Dec that use ConT instead of PromotedT -------------------------------------+------------------------------------- Reporter: aavogt | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.0.2 Component: Template Haskell | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bollmann): Also with promoted tuples quotation with quotation brackets `[t| .. |]` yields a different promoted type than the type obtained by reify. 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))) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11629#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11629: reify returns Dec that use ConT instead of PromotedT -------------------------------------+------------------------------------- Reporter: aavogt | Owner: Type: bug | Status: patch Priority: normal | Milestone: 8.0.2 Component: Template Haskell | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2188 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bollmann): * status: new => patch * differential: => Phab:D2188 Comment: 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. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11629#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11629: reify returns Dec that use ConT instead of PromotedT -------------------------------------+------------------------------------- Reporter: aavogt | Owner: Type: bug | Status: patch Priority: normal | Milestone: 8.2.1 Component: Template Haskell | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2188 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * milestone: 8.0.2 => 8.2.1 Comment: Bumping off to 8.2.1. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11629#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#11629: reify returns Dec that use ConT instead of PromotedT
-------------------------------------+-------------------------------------
Reporter: aavogt | Owner:
Type: bug | Status: patch
Priority: normal | Milestone: 8.2.1
Component: Template Haskell | Version: 7.10.2
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D2188
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Erik de Castro Lopo

#11629: reify returns Dec that use ConT instead of PromotedT -------------------------------------+------------------------------------- Reporter: aavogt | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Template Haskell | Version: 7.10.2 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2188 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11629#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC