[GHC] #13215: Panic: push_bang_into_newtype_arg

GHC ghc-devs at haskell.org
Fri Feb 3 13:00:13 UTC 2017


#13215: Panic: push_bang_into_newtype_arg
-------------------------------------+-------------------------------------
        Reporter:  nad               |                Owner:  mpickering
            Type:  bug               |               Status:  patch
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  crash or panic                     |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D3057
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 No, it's not a bug.  Consdier
 {{{
 newtype T a b c = MkT (c, Maybe (a,b))

 f :: T Int [x] y -> Bool
 f (MkT v) = ...
 }}}
 In the `ConPatOut` for `MkT` the `pat_arg_tys` will be a 3-element list,
 of `Int`, `[x]`, and `y`. When you call `dataConInstArgTys MkT <that
 list>` you'll get the singleton list back containing the type of `MkT`'s
 value arg: `(y, Maybe (Int,[x]))`.

 Now if `T` had no arguments thut
 {{{
 newtype T = MkT (Int -> Int)
 }}}
 then of course `pat_arg_tys` will be empty, but `dataConInstArgTys` will
 return the singleton contianing `Int -> Int`.

 Does that help?

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13215#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list