-
Notifications
You must be signed in to change notification settings - Fork 21
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
scala-js file order sensitive bug related to https://github.com/scala/scala/pull/7966? #11525
Comments
This one was tricky. File order in adriaanm/scala-js@9bb932c was discovered on CI (linux machine, also Eugene's dbuild box), whereas our macs compiled the project ok. |
self-contained repro: package java.lang
import java.util.Iterator
class Class[A](o: Object)
class Comparable[A] { def compareTo(o: A): scala.Int = ??? }
object System {
def currentTimeMillis(): scala.Long = ???
def arraycopy(src: Object, srcPos: scala.Int, dest: Object, destPos: scala.Int, length: scala.Int): Unit = {
import scala.{Boolean, Double}
def mismatch(): Nothing =
throw new ArrayStoreException("Incompatible array types")
def copyPrim[@specialized T](src: Array[T], dest: Array[T]): Unit = {
var i = length-1
while (i >= 0) {
dest(i+destPos) = src(i+srcPos)
i -= 1
}
}
def copyRef(src: Array[AnyRef], dest: Array[AnyRef]): Unit = {
val x = (src.length, dest.length)
var i = length-1
while (i >= 0) {
dest(i+destPos) = src(i+srcPos)
i -= 1
}
}
(src match {
case src: Array[Boolean] =>
dest match {
case dest: Array[Boolean] => copyPrim(src, dest)
case _ => mismatch()
}
})
}
def identityHashCode(x: Object): scala.Int = {
x.getClass
1
}
}
trait Iterable[T] {
def iterator(): java.util.Iterator[T]
}
Repro's pretty consistently with:
🤷♂ |
compiling this yields the same error:
|
I spent a lot of time trying to prune the repro, but this seems as small as I could get it. Just compiling this with |
Ok, I think I figured it out. |
to reproduce, checkout branch t11525 from https://github.com/adriaanm/scala-js
sbt javalanglib/compile
:The text was updated successfully, but these errors were encountered: