Skip to content
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

Error when compiling Scala 3 code using the new and experimental macro annotations #2006

Closed
alexarchambault opened this issue Feb 16, 2023 · 2 comments
Labels
bug A defect or misbehaviour. Scala 3

Comments

@alexarchambault
Copy link
Contributor

See this repo for a full reproduction.

When trying to compile this code (where @caseapp.entrypoint is a macro annotation), we get an error like:

E] Unexpected error when compiling project_9a380f230a-70bf441a95: 'Failed to find name hashes for Hello$.$method$hello$macro$1'
[E] Failed to compile 'project_9a380f230a-70bf441a95'

The README of the repro repository above has a server stacktrace corresponding to the exception of the "Failed to find name hashes for…" message (at the very end of the README).

@ckipp01 ckipp01 added bug A defect or misbehaviour. Scala 3 labels Feb 16, 2023
@tgodzik tgodzik added this to the Bloop v1.5.7 milestone Apr 6, 2023
@tgodzik tgodzik modified the milestones: Bloop v1.5.7, Bloop 1.5.10 Jul 12, 2023
@tgodzik tgodzik modified the milestones: Bloop 1.5.10, Bloop 2.0.7 Dec 30, 2024
@tgodzik
Copy link
Contributor

tgodzik commented Jan 2, 2025

Finally got back to it and it seems it's a zinc issue, same error in sbt:

sbt:dest> compile
[info] compiling 1 Scala source to /home/tgodzik/Documents/workspaces/bloop-macro-annotation-issue/dest/target/scala-3.3.0-RC2/classes ...
[error] ## Exception when compiling 1 sources to /home/tgodzik/Documents/workspaces/bloop-macro-annotation-issue/dest/target/scala-3.3.0-RC2/classes
[error] java.lang.RuntimeException: Failed to find name hashes for Hello$.$method$hello$macro$1
[error] scala.sys.package$.error(package.scala:30)
[error] sbt.internal.inc.AnalysisCallback.nameHashesForCompanions(Incremental.scala:992)
[error] sbt.internal.inc.AnalysisCallback.analyzeClass(Incremental.scala:999)
[error] sbt.internal.inc.AnalysisCallback.$anonfun$addProductsAndDeps$4(Incremental.scala:1022)
[error] scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:286)

@tgodzik tgodzik removed this from the Bloop 2.0.7 milestone Jan 2, 2025
@tgodzik
Copy link
Contributor

tgodzik commented Jan 2, 2025

I don't think there is anything to do here at this point especially since those macros are experimental and might easily change.

@tgodzik tgodzik closed this as not planned Won't fix, can't repro, duplicate, stale Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect or misbehaviour. Scala 3
Projects
None yet
Development

No branches or pull requests

3 participants