You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exception in thread "main" java.lang.AbstractMethodError: Receiver class Moons$package$$$Lambda$15/0x0000000800c074f8 does not define or inherit an implementation of the resolved method 'abstract .Named me()' of interface Named.
at Names.mkString$$anonfun$1(Moons.scala:18)
at scala.collection.Iterator$$anon$9.next(Iterator.scala:577)
at scala.collection.IterableOnceOps.addString(IterableOnce.scala:1184)
at scala.collection.IterableOnceOps.addString$(IterableOnce.scala:1179)
at scala.collection.AbstractIterator.addString(Iterator.scala:1293)
at scala.collection.IterableOnceOps.mkString(IterableOnce.scala:1129)
at scala.collection.IterableOnceOps.mkString$(IterableOnce.scala:1127)
at scala.collection.AbstractIterator.mkString(Iterator.scala:1293)
at scala.collection.IterableOnceOps.mkString(IterableOnce.scala:1142)
at scala.collection.IterableOnceOps.mkString$(IterableOnce.scala:1142)
at scala.collection.AbstractIterator.mkString(Iterator.scala:1293)
at Names.mkString(Moons.scala:18)
at $package$.Repro(Moons.scala:25)
at Repro.main(Moons.scala:23)
traitAdapter[T] extendsFunction1[T, Unit]
objectExample {
defmain(args: Array[String]):Unit= {
// In Scala 3 this causes a java.lang.AbstractMethodError
makeAdapter[Integer](123)
}
// Works in Scala 2.12 and 2.13 but generates wrong bytecode for Scala 3// due to using `(arg: Number) => ()` instead of `(arg: T) => ()`defmakeAdapter[T<:Number]:Adapter[T] = (arg: Number) => ()
Uh oh!
There was an error while loading. Please reload this page.
Compiler version
3.1.2
and
3.2.0-RC1-bin-20220607-76a0b29-NIGHTLY
Minimized code
Output
Scastie link
https://scastie.scala-lang.org/Odomontois/kzIirdZ1RRaDr1Wm8QN9TA/1
The text was updated successfully, but these errors were encountered: