-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Refine the type of inline vals with literal rhs #24472
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
base: main
Are you sure you want to change the base?
Conversation
6713020 to
1de787a
Compare
1de787a to
d7fcea3
Compare
|
@sjrd do you think that would require a SIP? |
At least a minor release. |
|
It definitely needs a minor release. In theory this is SIP material ... but IMO the SIP process is way too heavy for this. Let's add it to the next agenda, and hopefully there will be quick consensus. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we have just reused the tracked system?
Nevermind, but I think it's worth checking the interactions between the two.
I added a test that checks that: https://github.com/dotty-staging/dotty/blob/345fcba592e8e9e276fc0cbcd4396682cb8739e7/tests/neg/inline-tracked-val.scala ✅ |
Closes #24321.
This PR changes the type of
inline vals to be the exact type of the right-hand side if it is a literal, such that in following snippet,xwould have type(4: Int):Previously, it would not compile: