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
It would be nice if
f"hello, world" // scala.this.Predef.augmentString("hi").format()
produced just a constant string.
That enables
f"$$ordinary" // no cost "$ordinary" // looks like missing interpolator f"$$ordinary%n" // requires format, though could be improved
Locale is never used in rendering FixedString text.
But f just emits "hi".format() and the enhancement could be diverted:
f
package goodbye import Predef.{ augmentString => _ } object Test extends App { implicit class `bold format`(s: String) { def format(args: Any*): String = { Predef require args.isEmpty "goodbye, everybody" } } Console println f"hello, world" }
It's not obvious that this is sipped behavior. Someone wanting a special format could subvert the interpolator directly.
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-8608?orig=1 Reporter: @som-snytt Affected Versions: 2.11.0
Sorry, something went wrong.
@retronym said: I agree that we should emit java.lang.String.format(....) rather than emitting an untyped "".format(...) and hoping for the best.
java.lang.String.format(....)
"".format(...)
@som-snytt said: scala/scala#3769
@som-snytt said (edited on May 20, 2014 7:55:31 PM UTC): It will have to do some extra work since support for
f"${BigDecimal(3.4)}%e"
is in the wrapper, which unwraps.
@som-snytt said: scala/scala#3878
som-snytt
No branches or pull requests
It would be nice if
produced just a constant string.
That enables
Locale is never used in rendering FixedString text.
But
f
just emits "hi".format() and the enhancement could be diverted:It's not obvious that this is sipped behavior. Someone wanting a special format could subvert the interpolator directly.
The text was updated successfully, but these errors were encountered: