Skip to content

Conversation

@isovector
Copy link
Collaborator

@isovector isovector commented Sep 8, 2021

GHC provides dataConCannotMatch, which WIngman was using to filter out GADT data constructors which don't typecheck. But GHC doesn't do any reasoning about skolems in this function, so it assumes it can just unify any type variables that are present. This is entirely wrong --- skolems are definitely apart for all of Wingman's purposes.

Fixes #2171

matches <-
liftMaybe $
destructionFor
-- TODO(sandy): This needs a judgment in order to correctly compute
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed at #2173

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe it worths to add the link to the issue?

Copy link
Member

@jneira jneira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jneira jneira added the merge me Label to trigger pull request merge label Sep 15, 2021
@jneira
Copy link
Member

jneira commented Sep 16, 2021

I am afraid this needs a rebase

@isovector
Copy link
Collaborator Author

The test failure in MetaCataAST :

should be:

eval (IntLit n) = n

using GADT evidence, but instead we get:

eval (IntLit n) = _w0

Looks like it didn't learn that the type variable is equal to Int in this case!

@isovector isovector closed this Oct 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge me Label to trigger pull request merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wingman incorrectly ignores skolems when dealing with GADT evidence

2 participants