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

Prevent deprecation of _ in type patterns #18847

Closed
wants to merge 3 commits into from

Conversation

ausmarton
Copy link
Contributor

An attempt to prevent the deprecation of _ in type patterns as discussed in #18808

// under -source:future, `_` is deprecated for wildcard arguments of types: use `?` instead
val xs: List[_] = Nil
Copy link
Member

Choose a reason for hiding this comment

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

This change does not seem right. In that position, List[_] is not a pattern type, so _ should stay deprecated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks very much, I've removed the change to the test now. The fix isn't as trivial as I thought it was.

Copy link
Contributor

Choose a reason for hiding this comment

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

Currently this warining is not properly tested for cases that are not in patterns. I am adding tests in #18813.

@ausmarton ausmarton closed this Nov 12, 2023
@ausmarton
Copy link
Contributor Author

Closed since already fixed in #18887

@ausmarton ausmarton deleted the fix/I18808 branch November 12, 2023 00:01
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.

3 participants