We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
3.0.1
transparent inline def f: String = inline 10 match case _ => inline Some["foo"]("foo") match case Some(x) => x def test = inline val failMsg = f
8 | inline val failMsg = f | ^ | inline value must have a literal constant type
Should compile.
It looks like the type parameter of the Some.unapply is widened at some point. I would expect the inline match to be typed as:
Some.unapply
inline Some.apply["foo"]("foo") match case Some.unapply["foo"](x @ _) => x:"foo"
The text was updated successfully, but these errors were encountered:
Now the issue is that we generate an unnecessary binding
inline val failMsg: String = { val x: ("foo" : String) = "foo" x:String }
Sorry, something went wrong.
Propagate constant in result of inline match
2b9a62b
Fixes scala#13161
Propagate constant in result of inline match (#18455)
a4660af
Fixes #13161
6da31f7
Fixes #13161 [Cherry-picked 2b9a62b]
0fda02c
nicolasstucki
Successfully merging a pull request may close this issue.
Compiler version
3.0.1
Minimized code
Output
Expectation
Should compile.
It looks like the type parameter of the
Some.unapply
is widened at some point. I would expect the inline match to be typed as:The text was updated successfully, but these errors were encountered: