docs.scala-lang
docs.scala-lang copied to clipboard
String interpolation doc page should cover pattern matching
I was surprised today to notice that https://docs.scala-lang.org/overviews/core/string-interpolation.html makes no reference to the use of string interpolation in patterns, e.g. with the s interpolator:
scala 2.13.10> "foo bar" match { case s"f${x}r" => x }
^
warning: match may not be exhaustive.
val res1: String = oo ba
there is a bit of material on this https://docs.scala-lang.org/sips/string-interpolation.html but not very much (it only references a theoretical xml interpolator — understandable since the SIP predates any use of the feature in the Scala stdlib)