-
Notifications
You must be signed in to change notification settings - Fork 1.1k
False "No class, trait or object is defined in the compilation unit." warning when using deferred given #23049
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
note: That being said, it seems the error pops up independently from the option being passed when compiled with Scala CLI + Bloop... so I'm guessing it may be passed implicitly somewhere 🤔 scala-cli compile repro.scala -S 3.nightly
# Compiling project (Scala 3.7.1-RC1-bin-20250425-fb6cc9b-NIGHTLY, JVM (23))
# Warning: No class, trait or object is defined in the compilation unit.
# The incremental compiler cannot record the dependency information in such case.
# Some errors like unused import referring to a non-existent class might not be reported.
# Compiled project (Scala 3.7.1-RC1-bin-20250425-fb6cc9b-NIGHTLY, JVM (23)) the warning goes away when compiled with scala-cli compile repro.scala -S 3.nightly --server=false and comes back when scala-cli compile repro.scala -S 3.7.nightly --server=false -Yforce-sbt-phases
# No class, trait or object is defined in the compilation unit.
# The incremental compiler cannot record the dependency information in such case.
# Some errors like unused import referring to a non-existent class might not be reported.
#
# 1 warning found cc @tgodzik |
I discovered the issue in sbt project (without explicitly using that flag) so my understanding the sbt enable that Phase as part of enabling incremental compilation. I only used that flag to reproduce the issue in a simple single scalafile without involving sbt. |
Right, so the flag enables the warning (and is an easy way to reproduce with just the compiler script), as it runs the |
Compiler version
3.6.4
Minimized code
Compiled with the flag
-Yforce-sbt-phases
Output
Expectation
The code should compile without warnings.
The text was updated successfully, but these errors were encountered: