Skip to content

Commit 08efe53

Browse files
authored
Backport "Make the weak-conformance test work on Scala.js." to LTS (#18962)
Backports #17656 to the LTS branch. PR submitted by the release tooling.
2 parents f194963 + 7a3e0b8 commit 08efe53

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

tests/run/weak-conformance.scala

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
// scalajs: --skip --pending
2-
31
import collection.mutable.ArrayBuffer
42
object Test extends App {
53
inline val b = 33
@@ -16,11 +14,11 @@ object Test extends App {
1614
val x8 = List(5.toByte, 11) ; x8: List[Byte]
1715

1816
val x9: List[AnyVal] = List(1.0f, 0)
19-
assert(x9(0).getClass == classOf[java.lang.Float])
20-
assert(x9(1).getClass == classOf[java.lang.Float]) // expected type not fully defined, since `List` is covariant
17+
assert(x9(0).isInstanceOf[java.lang.Float])
18+
assert(x9(1).isInstanceOf[java.lang.Float]) // expected type not fully defined, since `List` is covariant
2119
val x10 = List[Any](1.0f, 0)
22-
assert(x10(0).getClass == classOf[java.lang.Float])
23-
assert(x10(1).getClass == classOf[java.lang.Integer])
20+
assert(x10(0).isInstanceOf[java.lang.Float])
21+
assert(x10(1).isInstanceOf[java.lang.Integer])
2422
}
2523

2624
locally {
@@ -35,11 +33,11 @@ object Test extends App {
3533
val x8 = ArrayBuffer(5.toByte, 11) ; x8: ArrayBuffer[Byte]
3634

3735
val x9: ArrayBuffer[AnyVal] = ArrayBuffer(1.0f, 0)
38-
assert(x9(0).getClass == classOf[java.lang.Float])
39-
assert(x9(1).getClass == classOf[java.lang.Integer]) // expected type fully defined since ArrayBuffer is nonvariant
36+
assert(x9(0).isInstanceOf[java.lang.Float])
37+
assert(x9(1).isInstanceOf[java.lang.Integer]) // expected type fully defined since ArrayBuffer is nonvariant
4038
val x10 = ArrayBuffer[Any](1.0f, 0)
41-
assert(x10(0).getClass == classOf[java.lang.Float])
42-
assert(x10(1).getClass == classOf[java.lang.Integer])
39+
assert(x10(0).isInstanceOf[java.lang.Float])
40+
assert(x10(1).isInstanceOf[java.lang.Integer])
4341
}
4442

4543
locally {
@@ -56,11 +54,11 @@ object Test extends App {
5654
val x8 = Array(5.toByte, 11) ; x8: Array[Int]
5755

5856
val x9: Array[AnyVal] = Array(1.0f, 0)
59-
assert(x9(0).getClass == classOf[java.lang.Float])
60-
assert(x9(1).getClass == classOf[java.lang.Integer]) // expected type fully defined since Array is nonvariant
57+
assert(x9(0).isInstanceOf[java.lang.Float])
58+
assert(x9(1).isInstanceOf[java.lang.Integer]) // expected type fully defined since Array is nonvariant
6159
val x10 = Array[Any](1.0f, 0)
62-
assert(x10(0).getClass == classOf[java.lang.Float])
63-
assert(x10(1).getClass == classOf[java.lang.Integer])
60+
assert(x10(0).isInstanceOf[java.lang.Float])
61+
assert(x10(1).isInstanceOf[java.lang.Integer])
6462
}
6563

6664
locally {
@@ -74,4 +72,4 @@ object Test extends App {
7472
val x7 = if (true) b else if (true) 33 else 'a' ; x7: Char
7573
val x8 = if (true) 5.toByte else 11 ; x8: Byte
7674
}
77-
}
75+
}

0 commit comments

Comments
 (0)