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.

`Exception: java.lang.OutOfMemoryError` (diverging implicits)

See original GitHub issue

Compiler version

3.1.1-RC1

Minimized code

https://github.com/armanbilge/schrodinger/commit/ed9a8bad6229fb8617615cf0397814b7a02fee52

Clone project in clean workspace and run sbt compile.

Apologies that this isn’t further minimized, not entirely sure how to approach this one. I’d appreciate any pointers.

FWIW it’s not a big project, and the module that seems to have the problem is 4 files with < 1k LOC total.

Output

[warn] In the last 8 seconds, 6.706 (86.2%) were spent in GC. [Heap: 0.10GB free of 4.00GB, max 4.00GB] Consider increasing the JVM heap using `-Xmx` or try a different collector, e.g. `-XX:+UseG1GC`, for better performance.

  | => monteCarlo / Compile / compileIncremental 312s

...

[warn] In the last 6 seconds, 5.215 (99.8%) were spent in GC. [Heap: 0.00GB free of 4.00GB, max 4.00GB] Consider increasing the JVM heap using `-Xmx` or try a different collector, e.g. `-XX:+UseG1GC`, for better performance.

Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "classloader-cache-cleanup-0

Note this occurs frequently, but not always. Sometimes it compiles just fine.

Expectation

My code compiles the first time and everything is hunky-dory 😃

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:21 (17 by maintainers)

github_iconTop GitHub Comments

3reactions
oderskycommented, Nov 9, 2021

I found a way to make the original test cases work without the search limit, by improving the way we recognize underspecified queries. The search limit is still there since there are other test cases where we need it.

1reaction
oderskycommented, Nov 3, 2021

@armanbilge Scala 2.13 treats diverging implicits differently from Scala 3 (and in a wrong way). I fear there’s not much we can do here. It’s a crazy combinatorial explosion of possibilities. The best thing to do would be to drop all these implicits and provide a general Order for 😗 instead. But that can only work in Scala 3 of course.

I won’t have the time to work on this, unfortunately. If nobody else takes this over until 30.11.2010, we will have to close the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

compile error "diverging implicit expansion for type scala.math ...
object Test2 { class TimeStamp(val toLong: Long) extends AnyVal with Ordered[TimeStamp] { def compare(that: TimeStamp) = java.lang.
Read more >
What is a diverging implicit expansion error? - Stack Overflow
I solved this error in a very different context, which might help someone else. The following did not work in my case: val...
Read more >
"diverging implicit expansion" error, another instance of 8541 ...
Ordering[A] because: hasMatchingSymbol reported error: could not find implicit value for parameter cmp: java.util.
Read more >
[Solved]-Why does scalac rise a "diverging implicit expansion" error ...
The compiler thinks that String :: String :: HNil both overlaps and dominates ComplexClass :+: CNil , and it bails out because that...
Read more >
Read Pure functional HTTP APIs in Scala | Leanpub
Looks good so far but it results in a compiler error. 1 [error] ...: diverging implicit expansion for type cats.kernel.Order[A] ...
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