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.

Can not load WeakPairMap$Pair$Weak$1 classfile

See original GitHub issue

Compiler version

3.0.0, on Java 11+

Minimized code

def foo: java.lang.WeakPairMap$Pair$Weak$1 = ???

Output

[info] running (fork) dotty.tools.dotc.Main -classpath /Users/linyxus/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.5/scala-library-2.13.5.jar:/Users/linyxus/Develop/dotty/library/../out/bootstrap/scala3-library-bootstrapped/scala-3.0.0-RC2/scala3-library_3.0.0-RC2-3.0.0-RC2-bin-SNAPSHOT.jar -color:never issue/weak-pair-map-classfile.scala
error while loading WeakPairMap$Pair$Weak$1,
class file /modules/java.base/java/lang/WeakPairMap$Pair$Weak$1.class is broken, reading aborted with class java.util.NoSuchElementException
key not found: K2
-- [E008] Not Found Error: issue/weak-pair-map-classfile.scala:1:19 ------------------------------------------------------------------------------------------------------------------------------------------
1 |def foo: java.lang.WeakPairMap$Pair$Weak$1 = ???
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |         type WeakPairMap$Pair$Weak$1 is not a member of java.lang - did you mean lang.WeakPairMap$Pair$Weak$1?
2 errors found
[error] Nonzero exit code returned from runner: 1
[error] (scala3-compiler / Compile / runMain) Nonzero exit code returned from runner: 1
[error] Total time: 3 s, completed May 26, 2021, 2:36:49 PM

Expectation

The compiler should load the classfile properly.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
smartercommented, Jun 3, 2021

Ah no, I missed the “is broken” part, that shouldn’t happen indeed.

1reaction
abgruszeckicommented, Jun 3, 2021

@Linyxus can you add your JVM version to the issue?

From myself I can add that other (?) classfile parses also seem to be having analogous problems: https://github.com/mockk/mockk/issues/130

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why am I getting a can't load class, when the class is in my ...
Within it, I'm attempting to connect to a web service, but am getting the error, "Cannot load java type: org.mainco.bsorg.
Read more >
Bad Class File Error... What am i doing wrong? — oracle-tech
I have the exact same problem - but unfortunately your solution doesn't work for me, because I believe my class is in the...
Read more >
How To Fix Minecraft Error LinkageError occurred ... - YouTube
How To Fix Minecraft: Java Edition Error: LinkageError occurred while loading main class net.minecraft.bundler.Main java.lang.
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