- Notifications
You must be signed in to change notification settings - Fork22
Description
Reproduction steps
2.13.16
With scalacOptions including
"-Wtostring-interpolated",and optionally (to make it an error)
"-Wconf:cat=w-flag-tostring-interpolated:e",compile this code:
valshouldCaps=truevalgreeting=s"Hello${if (shouldCaps)"WORLD"else"world"}"println(greeting)
seehttps://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 inscala/scala#10776