[GHC] #13250: Backpack: matching newtype selectors doesn't work
#13250: Backpack: matching newtype selectors doesn't work -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 8.1 (Type checker) | Keywords: backpack | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- {{{ unit p where signature A where newtype F a = F { mkF :: a } unit q where module A where newtype F a = F { mkF :: a } unit r where dependency p[A=q:A] }}} fails with {{{ ezyang@sabre:~$ ghc-head --backpack selector.bkp -dppr-debug [1 of 3] Processing p [2 of 3] Processing q Instantiating q [1 of 1] Compiling A ( q/A.hs, q/A.o ) [3 of 3] Processing r Instantiating r [1 of 1] Including p[A=q:A] Instantiating p[A=q:A] [1 of 1] Compiling A[sig] ( p/A.hsig, p/p-HVmFlcYSefiK5n1aDP1v7x/A.o ) ghc: panic! (the 'impossible' happened) (GHC version 8.1.20170123 for x86_64-unknown-linux): TcIface.find_lbl missing: mkF{v} known labels: [mkF{q:A.mkF{v rb}}] Call stack: CallStack (from HasCallStack): prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1166:58 in ghc:Outputable callStackDoc, called at compiler/utils/Outputable.hs:1170:37 in ghc:Outputable pprPanic, called at compiler/iface/TcIface.hs:841:41 in ghc:TcIface }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13250> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13250: Backpack: matching newtype selectors doesn't work -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler (Type | Version: 8.1 checker) | Resolution: duplicate | Keywords: backpack 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 ezyang): * status: new => closed * resolution: => duplicate Comment: This is caused by #12699. -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13250#comment:1> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
#13250: Backpack: matching newtype selectors doesn't work -------------------------------------+------------------------------------- Reporter: ezyang | Owner: ezyang Type: bug | Status: closed Priority: normal | Milestone: 8.2.1 Component: Compiler (Type | Version: 8.1 checker) | Resolution: duplicate | Keywords: backpack 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 Edward Z. Yang <ezyang@…>): In [changeset:"9d17028fbcecb53480598c4fcc7bd9e71b2ac7cf/ghc" 9d17028f/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="9d17028fbcecb53480598c4fcc7bd9e71b2ac7cf" Record full FieldLabel in ifConFields. Summary: The previous implementation tried to be "efficient" by storing field names once in IfaceConDecls, and only just enough information for us to reconstruct the FieldLabel. But this came at a bit of code complexity cost. This patch undos the optimization, instead storing a full FieldLabel at each data constructor. Consequently, this fixes bugs #12699 and #13250. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: adamgundry, bgamari, austin Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D3174 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13250#comment:2> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler
participants (1)
-
GHC