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.

knownDirectSubclasses of <class> observed before subclass <class> registered

See original GitHub issue

In: https://github.com/joan38/orchestra/tree/6d2c170f37040f2179479c6126292e030808ed08

Just rename: orchestra/src/main/scala/com/goyeau/orchestra/ARunStatus.scala to: orchestra/src/main/scala/com/goyeau/orchestra/RunStatus.scala

And enjoy:

[error] knownDirectSubclasses of RunStatus observed before subclass Running registered
[error] knownDirectSubclasses of RunStatus observed before subclass Success registered
[error] two errors found
[error] (orchestraJVM/compile:compileIncremental) Compilation failed

Related: https://github.com/lloydmeta/enumeratum/issues/90 https://issues.scala-lang.org/browse/SI-7046 https://github.com/scala/scala/pull/5284

Using: Scala 2.12.2 Circe 0.8.0

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

3reactions
ngbinhcommented, May 22, 2017

@lloydmeta @joan38 putting the extending classes and objects inside the companion object of the sealed trait will cause knownDirectSubclasses (sometimes can be intermittently due to incremental compiling).

2reactions
ngbinhcommented, May 22, 2017

right after upgrading to 2.12.0 (which contains this https://github.com/scala/scala/pull/5284 ), we’ve seen a lot more cases of knownDirectSubclasses in incremental compile. Move the direct subclasses outside of the sealed trait companion object definitely help in our case. But #434 looks scary! 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to avoid knownDirectSubclasses errors in Scala 2.12. ...
[error] knownDirectSubclasses of FileCommand observed before subclass ExecFile registered [error] one error found [error] ...
Read more >
Scala reflection: knownDirectSubclasses only works for ...
The JVM dynamically loads classes using a classloader (duh). It might have different loading rules for seemingly unrelated classes that just extend something ......
Read more >
typelevel/scala
I want to make a TLS 2.12.1 release before the break and I'd really like to get it in if possible.
Read more >
Warnings and known issues - circe
knownDirectSubclasses of <class > observed before subclass <class> registered. This is a known issue (#434, #659) that stems from the way fully automatic ......
Read more >
Use Scala Macros and Quasiquotes to Reduce Boilerplate
I found that the event processor implementation stored the handlers in a map with the registered class as the key. When an event...
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