question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`Cyclic reference involving module class` in Scala3 but compiles in Scala2

See original GitHub issue

Compiler version

3.0.0-RC1, 3.0.0-RC2

Minimized code

https://scastie.scala-lang.org/6NSAUSm4Qo2Y9NJbLQrxWw

Output

Cyclic reference involving module class JsonReaderDefaultValue$

Expectation

Successful compilation.

Does not reproduce when dependent code is copy-pasted to the same Scastie session.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
griggtcommented, Apr 15, 2021

Self-contained:

JsonReaderDefaultValue.scala (compile with Scala 2.13)

object JsonReaderDefaultValue extends LowPriorityDefaultValue {
  class ReaderDefaultValue extends scala.annotation.StaticAnnotation
}

trait LowPriorityDefaultValue {
  @JsonReaderDefaultValue.ReaderDefaultValue
  class NoDefaultValue
}

Test.scala

object Test {
  JsonReaderDefaultValue
}
0reactions
smartercommented, Apr 21, 2021

If you can’t minimize it, it can still be helpful to open an issue if you can provide a reliably way to reproduce the problem (e.g. a branch of a git repo and the command used to compile the code).

Read more comments on GitHub >

github_iconTop Results From Across the Web

illegal cyclic reference involving class · Issue #3809 · scala/bug
One of my concerns is that I might be allowing something to compile, but to miscompile. The code is behind a -Y option...
Read more >
Illegal cyclic reference involving class - scala - Stack Overflow
This gives me a compile error "illegal cyclic reference involving class myClass". The error goes away if I declare myClass as
Read more >
Scala example source code file (Types.scala) - Alvin Alexander
This example Scala source code file (Types.scala) is included in my "Source Code Warehouse" project. The intent of this project is to help...
Read more >
Scala Compiler Options
The Scala compiler scalac offers various compiler options, or flags, ... In Scala 2, default paths can be listed by running a tool...
Read more >
sbt Reference Manual — Combined Pages
Starts the Scala REPL with project classes and dependencies on the classpath ... with a classpath including the compiled sources and all dependencies....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found