Skip to content

String interpolation doc page should cover pattern matching #2687

Closed
@SethTisue

Description

@SethTisue

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)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions