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.ClassFormatError: Duplicate method name&signature in class file #8760

Closed
scabug opened this issue Jul 30, 2014 · 3 comments
Closed
Assignees

Comments

@scabug
Copy link

scabug commented Jul 30, 2014

Welcome to Scala version 2.11.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_05).
Type in expressions to have them evaluated.
Type :help for more information.

scala> :paste
// Entering paste mode (ctrl-D to finish)

object A{
  final val a = "a"
  final val b = "b"
  def foo(x: a.type) = x
  def foo(x: b.type) = x
}

// Exiting paste mode, now interpreting.

java.lang.ClassFormatError: Duplicate method name&signature in class file A$
  at java.lang.ClassLoader.defineClass1(Native Method)
  at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
  at scala.reflect.internal.util.AbstractFileClassLoader.findClass(AbstractFileClassLoader.scala:87)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  at java.lang.Class.getDeclaredMethods0(Native Method)
  at java.lang.Class.privateGetDeclaredMethods(Class.java:2688)
  at java.lang.Class.privateGetPublicMethods(Class.java:2814)
  at java.lang.Class.getMethods(Class.java:1602)
  at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.evalMethod(IMain.scala:800)
  at scala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:734)
  at scala.tools.nsc.interpreter.IMain$Request.loadAndRun(IMain.scala:986)
  at scala.tools.nsc.interpreter.IMain$WrappedRequest$$anonfun$loadAndRunReq$1.apply(IMain.scala:593)
  at scala.tools.nsc.interpreter.IMain$WrappedRequest$$anonfun$loadAndRunReq$1.apply(IMain.scala:592)
  at scala.reflect.internal.util.ScalaClassLoader$class.asContext(ScalaClassLoader.scala:31)
  at scala.reflect.internal.util.AbstractFileClassLoader.asContext(AbstractFileClassLoader.scala:19)
  at scala.tools.nsc.interpreter.IMain$WrappedRequest.loadAndRunReq(IMain.scala:592)
  at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:524)
  at scala.tools.nsc.interpreter.IMain.interpret(IMain.scala:520)
  at scala.tools.nsc.interpreter.ILoop.interpretCode$1(ILoop.scala:707)
  at scala.tools.nsc.interpreter.ILoop.pasteCommand(ILoop.scala:721)
  at scala.tools.nsc.interpreter.ILoop$$anonfun$standardCommands$10.apply(ILoop.scala:220)
  at scala.tools.nsc.interpreter.ILoop$$anonfun$standardCommands$10.apply(ILoop.scala:220)
  at scala.tools.nsc.interpreter.LoopCommands$LineCmd.apply(LoopCommands.scala:62)
  at scala.tools.nsc.interpreter.ILoop.command(ILoop.scala:661)
  at scala.tools.nsc.interpreter.ILoop.processLine(ILoop.scala:433)
  at scala.tools.nsc.interpreter.ILoop.loop(ILoop.scala:450)
  at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply$mcZ$sp(ILoop.scala:868)
  at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply(ILoop.scala:854)
  at scala.tools.nsc.interpreter.ILoop$$anonfun$process$1.apply(ILoop.scala:854)
  at scala.reflect.internal.util.ScalaClassLoader$.savingContextLoader(ScalaClassLoader.scala:95)
  at scala.tools.nsc.interpreter.ILoop.process(ILoop.scala:854)
  at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:74)
  at scala.tools.nsc.MainGenericRunner.run$1(MainGenericRunner.scala:87)
  at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:98)
  at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:103)
  at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
@scabug
Copy link
Author

scabug commented Jul 30, 2014

Imported From: https://issues.scala-lang.org/browse/SI-8760?orig=1
Reporter: kenji yoshida
Affected Versions: 2.10.4, 2.11.2
Duplicates #8323

@scabug
Copy link
Author

scabug commented Jul 30, 2014

@gourlaysama said:
This is a duplicate of #8323.

@scabug
Copy link
Author

scabug commented Jul 30, 2014

@retronym said:
Merging with #8323

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

No branches or pull requests

2 participants