Skip to content

Fix #1716: Don't allow wildcards as type arguments to methods #1860

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

Merged
merged 2 commits into from
Dec 26, 2016

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Dec 25, 2016

Wildcards don't make sense as type arguments to methods, and I believe to keep things
simple this should also apply to method type arguments in patterns.

The best way to enforce this is to make use of the existing infrastructure in the parser
for topLevelTypes.

This is an alternate fix for #1716 more in line with the way we exclude wildcards in types already.

Review by @liufengyun ?

Wildcards don't make sense as type arguments to methods, and I believe to keep things
simple this should also apply to method type arguments in patterns.

The best way to enforce this is to make use of the existing infrastructure in the parser
for topLevelTypes.
Copy link
Contributor

@liufengyun liufengyun left a comment

Choose a reason for hiding this comment

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

Otherwise, LGTM, it's a much better fix 👍

@@ -0,0 +1,9 @@
object Fail {
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems a slip here: move the test from tests/pending/neg to tests/neg

@liufengyun liufengyun merged commit 1b3649d into scala:master Dec 26, 2016
@allanrenucci allanrenucci deleted the fix-#1716-v2 branch December 14, 2017 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants