`Exception: java.lang.OutOfMemoryError` (diverging implicits)
See original GitHub issueCompiler 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:
- Created 2 years ago
- Comments:21 (17 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
@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.