[GHC] #13250: Backpack: matching newtype selectors doesn't work

GHC ghc-devs at haskell.org
Thu Feb 9 07:45:25 UTC 2017


#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 at 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


More information about the ghc-tickets mailing list