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

java.lang.NoSuchMethodError: 'void scala.tools.nsc.reporters.Reporter.error(scala.reflect.internal.util.Position, java.lang.String)' with Scala 2.13.12+ #431

Open
gervaisb opened this issue Nov 18, 2024 · 2 comments

Comments

@gervaisb
Copy link

gervaisb commented Nov 18, 2024

As already reported inside another issue (#381 (comment)) there is an execution error with Scala 2.13.12 and above when the plugin try to report an error.

[error] ## Exception when compiling 10 sources to /********/target/scala-2.13/test-classes
[error] java.lang.NoSuchMethodError: 'void scala.tools.nsc.reporters.Reporter.error(scala.reflect.internal.util.Position,
java.lang.String)'
[error] org.virtuslab.ash.SerializabilityCheckerCompilerPluginComponent$$anon$1.$anonfun$apply$10(SerializabilityCheckerCo
mpilerPluginComponent.scala:174)
[error] scala.collection.IterableOnceOps.$anonfun$foldRight$1(IterableOnce.scala:755)
[error] scala.collection.LinearSeqOps.foldLeft(LinearSeq.scala:183)
[error] scala.collection.LinearSeqOps.foldLeft$(LinearSeq.scala:179)
[error] scala.collection.immutable.List.foldLeft(List.scala:79)
[error] scala.collection.IterableOnceOps.foldRight(IterableOnce.scala:755)
[error] scala.collection.IterableOnceOps.foldRight$(IterableOnce.scala:755)
[error] scala.collection.AbstractIterable.foldRight(Iterable.scala:935)
[error] org.virtuslab.ash.SerializabilityCheckerCompilerPluginComponent$$anon$1.apply(SerializabilityCheckerCompilerPlugin
Component.scala:148)
[error] scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:481)
[error] scala.tools.nsc.Global$GlobalPhase.run(Global.scala:428)
[error] scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1549)
[error] scala.tools.nsc.Global$Run.compileUnits(Global.scala:1533)
[error] scala.tools.nsc.Global$Run.compileSources(Global.scala:1525)
[error] scala.tools.nsc.Global$Run.compileFiles(Global.scala:1638)
[error] scala.tools.xsbt.CachedCompiler0.run(CompilerBridge.scala:176)
[error] scala.tools.xsbt.CachedCompiler0.run(CompilerBridge.scala:139)
[error] scala.tools.xsbt.CompilerBridge.run(CompilerBridge.scala:43)
[error] sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:91)
[error] sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$7(MixedAnalyzingCompiler.scala:193)
[error] scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
[error] sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:248)
[error] sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:183)
[error] sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4$adapted(MixedAnalyzingCompiler.scala:163)
[error] sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:239)
[error] sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:163)
[error] sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:211)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:534)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:534)
[error] sbt.internal.inc.Incremental$.$anonfun$apply$5(Incremental.scala:180)
[error] sbt.internal.inc.Incremental$.$anonfun$apply$5$adapted(Incremental.scala:178)
[error] sbt.internal.inc.Incremental$$anon$2.run(Incremental.scala:464)
[error] sbt.internal.inc.IncrementalCommon$CycleState.next(IncrementalCommon.scala:116)
[error] sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:56)
[error] sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:52)
[error] sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:263)
[error] sbt.internal.inc.Incremental$.$anonfun$incrementalCompile$8(Incremental.scala:419)
[error] sbt.internal.inc.Incremental$.withClassfileManager(Incremental.scala:506)
[error] sbt.internal.inc.Incremental$.incrementalCompile(Incremental.scala:406)
[error] sbt.internal.inc.Incremental$.apply(Incremental.scala:172)
[error] sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:534)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:488)
[error] sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:332)
[error] sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:425)
[error] sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:137)
[error] sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:2371)
[error] sbt.Defaults$.$anonfun$compileIncrementalTask$2(Defaults.scala:2321)
[error] sbt.internal.server.BspCompileTask$.$anonfun$compute$1(BspCompileTask.scala:31)
[error] sbt.internal.io.Retry$.apply(Retry.scala:47)
[error] sbt.internal.io.Retry$.apply(Retry.scala:29)
[error] sbt.internal.io.Retry$.apply(Retry.scala:24)
[error] sbt.internal.server.BspCompileTask$.compute(BspCompileTask.scala:31)
[error] sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:2319)
[error] scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:63)
[error] sbt.std.Transform$$anon$4.work(Transform.scala:69)
[error] sbt.Execute.$anonfun$submit$2(Execute.scala:283)
[error] sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:24)
[error] sbt.Execute.work(Execute.scala:292)
[error] sbt.Execute.$anonfun$submit$1(Execute.scala:283)
[error] sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error] sbt.CompletionService$$anon$2.call(CompletionService.scala:65)
[error] java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
[error] java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
[error] java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
[error] java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
[error] java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
[error] java.base/java.lang.Thread.run(Thread.java:1583)

As you can see in 2.13.11, the report(Position, String) method exist : https://github.com/scala/scala/blob/f113b1ab477ae2052725fe0b7ba5ae2796903807/src/reflect/scala/reflect/internal/Reporting.scala#L111

However, since 2.13.12 a new parameter has been added to the method: error(Position, String, List[CodeAction]) https://github.com/scala/scala/blob/80514f73a6c7db32df9887d9a5ca9ae921e25118/src/reflect/scala/reflect/internal/Reporting.scala#L120

@PawelLipski
Copy link
Collaborator

Huh how come is CI passing under Scala 2.13.14 😯 lemme investigate

@PawelLipski
Copy link
Collaborator

Aww, latest version built against 2.13.15 not released 😅 I'll sort that out soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants