Skip to content

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

Open
eejbyfeldt opened this issue Apr 25, 2025 · 0 comments
Labels
itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label

Comments

@eejbyfeldt
Copy link

Compiler version

3.6.4

Minimized code

Compiled with the flag -Yforce-sbt-phases

trait TC[X]
object TC {
  given [X: scala.deriving.Mirror.ProductOf]: TC[X] = ???
}

trait Base[T] {
  given TC[T] = scala.compiletime.deferred
}

case class P()
object A extends Base[P]

Output

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

Expectation

The code should compile without warnings.

@eejbyfeldt eejbyfeldt added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label
Projects
None yet
Development

No branches or pull requests

1 participant