You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@nicolasstucki Say I want to tackle this, I have some questions regarding the implementation.
Where should I start? Where are these implemented in the compiler?
Does changing s, f, etc. to inline affect binary compatibility?
Theoretically we can special case this only within the context of compiletime.error(), since we can read the tree as a raw StringContext and constant fold it accordingly. Is this better, or should we treat interpolation just like arithmetic operations that are inlined anywhere?
I must have looked at this on Mar 22 when I had less time. I think the answer to 3 must be that it should be normal constant folding, it's adding string constants. Getting the Scala 2 f to emit constants was a priority. There was also a Scala 2 ticket to make interpolation work normally in the annotation, where type param names are available as constant strings in a special context. I started hacking on Scala 3 f but haven't returned to it yet in my freer time. I remember wondering if it matters that stringInterpolatorOpt runs rather late.