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

Runtime exception when auxilary constructor arguments involves base types #7007

Closed
scabug opened this issue Jan 23, 2013 · 3 comments
Closed
Assignees
Labels
Milestone

Comments

@scabug
Copy link

scabug commented Jan 23, 2013

Under Scala 2.10.0 (and scala-2.10.1-20130120-002536-18a906bb9a) a java.lang.NoSuchMethod runtime excpetion occurs with the test code below.
No runtime exception under Scala 2.9.

Test code:

class A
class B extends A

class Crash(b1: Seq[B], b2: Seq[B]) {
  def this(a: Seq[A]) = this(a.collect{ case b: B => b}, a.collect{ case b: B => b})
}

object Main extends App {

  // runtime exception with either constructor
  val c1 = new Crash(Seq(new B, new B))
  val c2 = new Crash(Seq(new B), Seq(new B))

}

Exception:

java.lang.NoSuchMethodError: A.(I)V
at Scala10$delayedInit$body.apply(scala10_2.scala:29)
at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scala.App$$anonfun$main$1.apply(App.scala:71)
at scala.App$$anonfun$main$1.apply(App.scala:71)
at scala.collection.immutable.List.foreach(List.scala:309)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32)
at scala.App$class.main(App.scala:71)
at Scala10$.main(scala10_2.scala:21)
at Scala10.main(scala10_2.scala)

@scabug
Copy link
Author

scabug commented Jan 23, 2013

Imported From: https://issues.scala-lang.org/browse/SI-7007?orig=1
Reporter: Miles Trebilco (miles)
Affected Versions: 2.10.0
See #6666

@scabug
Copy link
Author

scabug commented Jan 23, 2013

@retronym said (edited on Jan 23, 2013 7:29:23 AM UTC):
Kin of #6666

@scabug
Copy link
Author

scabug commented Aug 28, 2013

@retronym said:
This gives a decent compiler error these days, test case in scala/scala#2884

@scabug scabug closed this as completed Sep 15, 2013
@scabug scabug added the has PR label Apr 7, 2017
@scabug scabug added this to the 2.11.0-M6 milestone Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants