Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix over-restrictive rule for generic cap pattern matching #2597

Closed
wants to merge 1 commit into from

Conversation

Praetonus
Copy link
Member

@Praetonus Praetonus commented Mar 12, 2018

The new rule for generic capability pattern matching introduced in bab5b3a turned out to be too restrictive and disallowed legitimate cases.

This changes the rule from

"every possible instantiation of the operand is a subtype of every possible instantiation of the pattern"

to

"every possible instantiation of the operand is a subtype of some possible instantiation of the pattern"

Closes #2584.

No changelog entry since this fixes an unreleased bug.

The new rule for generic capability pattern matching introduced in
bab5b3a turned out to be too restrictive and disallowed legitimate
cases.

This changes the rule from

"every possible instantiation of the operand is a subtype of every
possible instantiation of the pattern"

to

"every possible instantiation of the operand is a subtype of some
possible instantiation of the pattern"

Closes ponylang#2584.
@Praetonus
Copy link
Member Author

There are some issues with this that I'd like to discuss before going forward. I'll sum up my concerns in #2584.

@Praetonus Praetonus added the do not merge This PR should not be merged at this time label Mar 13, 2018
@Praetonus
Copy link
Member Author

I'm going to close this PR since at that point I'm fairly convinced that this isn't the correct solution. See #2584 for further discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge This PR should not be merged at this time
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem with matching generic types
1 participant