Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IncompatibleClassChangeError #1424

Open
axaluss opened this issue Jan 20, 2024 · 1 comment
Open

IncompatibleClassChangeError #1424

axaluss opened this issue Jan 20, 2024 · 1 comment
Assignees
Labels
more info Requires more info from the user

Comments

@axaluss
Copy link

axaluss commented Jan 20, 2024

scalaJSLinkerConfig ~= {
      _.withESFeatures(_.withESVersion(ESVersion.ES2020))
    }
ThisBuild / scalaVersion := "2.13.11"

      "dev.optics" %%% "monocle-core"  % "3.2.0",
      "dev.optics" %%% "monocle-macro" % "3.2.0"

i'm running this scalatest scala.js test from intellij:

case class Chat(history:List[String])

chat.focus(_.history).replace(Nil)

It doesn't like to run the focus(_.history):

An exception or error caused a run to abort. This may have been caused by a problematic custom reporter.
java.lang.IncompatibleClassChangeError: class com.my.FooBarSpec$$anon$1 can not implement monocle.PLens, because it is not an interface (monocle.PLens is in unnamed module of loader 'app')
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
	at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
	at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3373)
	at java.base/java.lang.Class.getConstructor0(Class.java:3578)
	at java.base/java.lang.Class.getConstructor(Class.java:2271)
	at org.scalatest.tools.SuiteDiscoveryHelper$.isAccessibleSuite(SuiteDiscoveryHelper.scala:180)
	at org.scalatest.tools.SuiteDiscoveryHelper$.isAccessibleSuite(SuiteDiscoveryHelper.scala:190)
	at org.scalatest.tools.Runner$.$anonfun$doRunRunRunDaDoRunRun$6(Runner.scala:1180)
	at org.scalatest.tools.Runner$.$anonfun$doRunRunRunDaDoRunRun$6$adapted(Runner.scala:1177)
.....
@armanbilge
Copy link
Contributor

i'm running this scalatest scala.js test from intellij:

Do you get the same error if you run the test from sbt? Could this be an IntelliJ bug?

@yilinwei yilinwei self-assigned this Jan 25, 2024
@yilinwei yilinwei added the more info Requires more info from the user label Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info Requires more info from the user
Projects
None yet
Development

No branches or pull requests

3 participants