-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Parser should reject wildcards in invalid positions #4373
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
Comments
The parser is already responsible for rejecting: class Foo[X <: _] I think it should also be able to reject your examples. Here's a few more: class A1 extends _
object Test {
type T1 = _
type T2 = _[Int]
type T3 = _ { type S }
type T4 = [X] => _
} |
I can give this a try, it's a good exercise. (Whether I can do it timely is a different question.) |
I guess the plan is to fix the parser by extending the existing strategy, that is carefully thread |
I don't think any of the problematic case are context dependent so no need to pass a parameter around, just check that there is no wildcard when parsing the type trees where wildcards should not be allowed. |
Fix scala#4373. The testcase is from examples in scala#4373, variations and tests for types with wildcards. I'm unsure for a couple cases.
Fix scala#4373. The testcase is from examples in scala#4373, variations and tests for types with wildcards. I'm unsure for a couple cases.
Fix scala#4373. The testcase is from examples in scala#4373, variations and tests for types with wildcards.
Fix scala#4373. The testcase is from examples in scala#4373, variations and tests for types with wildcards.
Fix #4373: reject wildcard types in syntactically invalid positions
Seems to be caused by wildcards in unions or intersections in type bounds.
The text was updated successfully, but these errors were encountered: