You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Funnily, the type of the expression is Any, probably because the expected type for interpolated exprs is Any, and if/else uses the expected type (there's no need to lub, given that the branches conform to the expected type).
It wouldn't be terrible if the lint must check arms of an if, or maybe also cases of a match; just a bit ugly.
Reproduction steps
2.13.16
With scalacOptions including
and optionally (to make it an error)
compile this code:
see https://scastie.scala-lang.org/MQWIvMVXSrCwU9u9D8NTCA
Output
there is a warning/error raised on line 2:
"interpolation uses toString"
Expectation
compiles without warnings, as the type of the expression is a String
Additional info
Also fails on 3.7.1-RC1
Feature introduced in scala/scala#10776
The text was updated successfully, but these errors were encountered: