Skip to content

Split correctly on datatypes with existential type variables #32

@WorldSEnder

Description

@WorldSEnder
{-# LANGUAGE GADTs, RankNTypes #-}

data E a b where
  E :: forall a b. (b ~ a, Ord a) => b -> E a [a]

test :: E Int b -> Int
test x = _

In the above, case splitting on x will result in

test x = (case x of { (E stltlbl_i b) -> _ })

which introduces an additional argument to E that should not be there. My suspicion is that this was introduced with 79b98f0 which is the opposite of what I'd expect from the commit message.

Can you shed more light on what issue the commit was fixing @konn ? Replacing dataConInstArgTys with dataConInstOrigArgTys seems to work fine with ghc 8.6.5 and also works with the above test case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions