-
Notifications
You must be signed in to change notification settings - Fork 233
Origin: move out of internal
#3454
New issue
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
Conversation
I think we use Origin in quite a few places outside of scalameta so it makes sense to move it out of internal. |
Alternatively, we could expose more methods similar to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is my understanding even true? if origin is not a public field, does it really have to abide by any interface when quasiquotes are involved?
Yes, I believe so - even though the field is not public, its type needs to be MiMa-protected if it's referenced in macro expansions, to ensure that in the future, quasiquotes compiled in a previous semver-compatible version can be linked.
The end goal of #3425 and what exactly should be exposed goes beyond my understanding/knowledge, but this PR is definitely a needed follow-up to #3450 to avoid the same challenges we discussed a while ago on Discord:
I had a quick look with -Vprint:typer: 4.7.x quasiquotes expand to internal.Impl.unapply (since f879984). Independently of our discussion, that means that there is a risk of breaking backward compatibility for quasiquotes in the future as MiMa does not run on extractors referenced by the expanded code.
(I see there is very active progress on this massive effort, thanks a lot for keeping backward compatibility in mind despite the complexity!) |
@bjaglin thanks for chiming in. a further question:
|
I see your point, it's hard to tell what's really contractual at macro expansion time... Did you have a look at code generated by the quasiquotes macros with |
i don't really know how to do that, truth be told... 😊 |
There is probably an easier way to do it, but what I did last time was to add And ... now that I write this, I realize |
As origin is now saved as part of quasiquotes, let's make sure it abides by MIMA standards (which are not currently applied to `internal` code). Similarly, remove TokenStreamPosition and inline in Origin.Parsed.
As origin is now saved as part of quasiquotes, let's make sure it abides by MIMA standards (which are not currently applied to
internal
code).Similarly, remove TokenStreamPosition and inline in Origin.Parsed. Helps with #3425.