-
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
Unexpected New (...) reached GenBCode #16357
Comments
I think this one is related to the default implementation of |
The problem is (I tested) that you should be wrapping new in a call to the constructor, Apply(
Select(
New(TypeTree.ref(cl)), cl.primaryConstructor
),
Nil
) since this is always needed, perhaps we should deprecate the old |
perhaps :) I know I'm very likely doing something wrong but it seemed like a message I shouldn't be seeing! |
By compiling this code with checking t/Test_2.scala after phase inlining
java.lang.AssertionError: assertion failed: `New` node must be wrapped in a `Select`:
parent = new Object with demo.MyAlg[F] {...}:demo.MyAlg[F]
child = new Object with demo.MyAlg[F] {...} while running Ycheck on t/Test_2.scala
exception occurred while compiling t/Test_2.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: `New` node must be wrapped in a `Select`:
parent = new Object with demo.MyAlg[F] {...}:demo.MyAlg[F]
child = new Object with demo.MyAlg[F] {...} while compiling t/Test_2.scala
java.lang.AssertionError: assertion failed: `New` node must be wrapped in a `Select`:
parent = new Object with demo.MyAlg[F] {...}:demo.MyAlg[F]
child = new Object with demo.MyAlg[F] {...} |
This is not something we could we could do in the |
We mention that the constructor must be selected. This should be all the information needed in case someone writes a buggy macro that does not include the `Select` around the `New`. Closed scala#16357
Compiler version
3.2.1
Minimized code
macros.scala
main.scala
Output (click arrow to expand)
The text was updated successfully, but these errors were encountered: