-
Notifications
You must be signed in to change notification settings - Fork 1.1k
stale symbol involving trait mixin when defining and using macro in same project #12140
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
This is caused by having a macro defined and used in the same project, this requires the compiler to execute itself multiple times, and somehow when combined with mixing in traits this doesn't work. If I move TypeInfo to its own project that the main project depends on, it compiles fine: smarter/squeryl@c33e582 /cc @nicolasstucki @odersky |
thanks for the swift response @smarter! I am going to do that then. |
I minimised this using my example from #10043, but adding implicit modifier // Trait.scala
package example
import quoted._
trait Trait {
implicit val foo: Int = 23
}
object Trait {
inline def get: Trait = ${ getImpl }
def getImpl(using Quotes): Expr[Trait] = '{ new Trait {} }
} // Test.scala
@main def Test = println(example.Trait.get)
|
I'm seeing this error again using scala 3.0.0 as part of the CI of this PR, see https://github.com/squeryl/squeryl/pull/321/checks?check_run_id=2591158482 Note that I don't see it locally (I'm running hotspot's java 8 locally) |
The fix is only in master and nightly builds, not 3.0.0 which was branched off before that. |
I see, thanks for the info! |
Compiler version
3.0.0-RC2
Minimized code
I'm trying to compile the squeryl library under scala 3.0.0-RC2 and this line seems to be responsible for the compiler crashing:
I don't know how relevant this is to the actual error (see below) but that's the line the compiler points me to. I am note quite sure how to minimise it, but I could give it a try if someone could give me some advice as to how to approach it. Note that you can see the error for yourself in the CI checks (github action) of this PR.
Output
Expectation
Strangely, I have got a computer where it compiles ok, but another where it doesn't and the CI where it doesn't either. I'd expect it to always compile.
The text was updated successfully, but these errors were encountered: