-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Unexpected tree could not be interpreted #5097
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
Comments
That's because of the inline accessor. We either need to "see through" such accessors or forbid them (but then a better error message would help). |
But why can't we "see through" in the macro |
The issue is that we are generating the accessor a private member of the object in the class. If we have the following code class Foo {
rewrite def foo0: String = Foo.impl1
}
object Foo {
rewrite def foo1: String = Foo.impl1
rewrite def foo2: String = Foo.impl2
private def impl1: String = ""
private def impl2: String = ""
} after typer we currently have result of Foo.scala after frontend:
package <empty> {
class Foo() extends Object() {
rewrite def foo0: String = Foo.impl1
def inline$impl1: String = Foo.impl1
}
final lazy module val Foo: Foo$ = new Foo$()
final module class Foo$() extends Object() { this: Foo.type =>
rewrite def foo1: String = Foo.impl1
rewrite def foo2: String = Foo.impl2
private def impl1: String = ""
private def impl2: String = ""
def inline$impl1: String = Foo.impl1
def inline$impl2: String = Foo.impl2
}
} Note that we generated one |
Check if still occurs after #5138 is merged. |
If
def impl
is not private, the code compilesThe text was updated successfully, but these errors were encountered: