-
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
Unhelpful "Tree had an unexpected owner" error message #16363
Comments
Sometimes I'm even seeing this:
|
There is a bug in the maco implementation. The code instantiates 3 times a new symbol for the same methods ( To fix the macro implementation one needs to the method symbol once when creating the class symbol. Then that symbol can be recovered using def method(owner: Symbol) = Symbol.newMethod(..., "test", ...)
val clazz = Symbol.newClass(...)
val testSym = clazz.methodMember("test").head
ClassDef(
clazz,
Nil,
List(
DefDef(
testSym,
argss =>
Some(
Lambda(testSym, methodType, (ls, _) => {
'{ ??? }.asTerm
})
)
)
),
) |
@nicolasstucki I'm aware the macro may be buggy, the problem I was reporting is just the... reporting :) |
The description of the error was meant as an in depth analysis of the issue that can be compared to the new hint that will be reported when such an error occurs. Anyone else having a look at this issue would not necessarily have this insight. |
I see, thank you. |
Compiler version
3.2.1
Minimized code
Output
Full output
Expectation
Something that distinguishes the actual owner from the expected one.
The text was updated successfully, but these errors were encountered: