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

Don't trust @unchecked types when optimizing type tests #14709

Closed
wants to merge 2 commits into from

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Mar 18, 2022

Some type tests are elided or replaced with non null-checks if we can show
that the expression's type is a subtype of the test type. But that can be done
safely only if the expression's type does not come from an @unchecked cast,
inserted by pattern matching or the user.

Fixes #14705

Some type tests are elided or replaced with non null-checks if we can show
that the expression's type is a subtype of the test type. But that can be done
safely only if the expression's type does not come from an `@unchecked` cast,
inserted by pattern matching or the user.

Fixes scala#14705
tests/run/i14693.scala Outdated Show resolved Hide resolved
@odersky
Copy link
Contributor Author

odersky commented Mar 21, 2022

Closed in favor of #14715

@odersky odersky closed this Mar 21, 2022
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.

Pattern matching on unchecked generic types (with isInstanceOf guard) does not work correctly
3 participants