Skip to content

Make StringContext.{f,raw} into macros in 2.13 #11366

@retronym

Description

@retronym

Followup work from scala/scala#6093

We couldn't do this in 2.12 due to the source incompatibility, but we might be willing to break this for 2.13.

If we do, we, need to:

  • factor the code in refchecks into something we can share with FastTrack's use of scala.tools.reflect.FormatInterpolator.
  • after the subsequent restarr, replace StringContext.{s,f} with fast tracked macros.

The benefit of a macro over an intrinsic is that we avoid divergence between the intrinsified and regular behaviour. Currently, the intrinsic defers the the regular behaviour when the tree shapes are non-standard, e.g. a manual call to StringContext.s with non-literal arguments for parts. The f interpolator, which is already a macro, just emits a compile error for that case.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions