-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Binary Break Affecting Macro Annotations Compiled on 3.3 #22352
Comments
A quick check within the @experimental class debuggable extends MacroAnnotation {
[error] | ^
[error] |class debuggable needs to be abstract, since def transform
[error] | (using x$1: scala.quoted.Quotes)
[error] | (definition: x$1.reflect.Definition, companion:
[error] | Option[x$1.reflect.Definition]): List[x$1.reflect.Definition] in trait MacroAnnotation in package scala.annotation is not defined
[error] |(The class implements a member with a different type: def transform
[error] | (using x$1: scala.quoted.Quotes)
[error] | (tree: x$1.reflect.Definition): List[x$1.reflect.Definition] in class debuggable in package parsley) Which is indeed a binary break. Is it even possible to resolve this? If the API for macro-annotations is broken from the LTS 3.3 series, then basically no cross-compiled libraries would be able to use them! I would guess this is possible to resolve by making this method non-abstract and have a forwarder to the new method with a default argument provided. |
I understand that, however, in this case this is fixable with a simple forwarder method, I believe. |
Sure, but that's not the API we want to have (for now), see SIP-63. |
As a mitigation for Scala 3.3 targeting library authors, just add def transform(using Quotes)(tree: quotes.reflect.Definition, companion: Option[quotes.reflect.Definition]): List[quotes.reflect.Definition] = transform(tree) To your annotation class, it will work again |
Just to add more context, here is the PR that changed this: #19677 |
The change behind this was intentional, it is not an error. |
Compiler version
3.6.2 (but also applies as far back as 3.5.0, works on 3.4)
Minimized code
Using
scala --dependency com.github.j-mie6::parsley-debug::5.0.0-M9
Then, use the annotation
@parsley.debuggable
, which is a macro annotation compiled on3.3.1
.Output (click arrow to expand)
This also happens outside the REPL. From my understanding of
AbstractMethodError
, this means the binary API of macro-annotations was broken from 3.3/3.4 at 3.5.The text was updated successfully, but these errors were encountered: