diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/pending/pos/t8230a.scala | 26 | ||||
-rw-r--r-- | tests/pos/array-overload.scala | 8 | ||||
-rw-r--r-- | tests/run/arrayclone-new.scala (renamed from tests/pending/run/arrayclone-new.scala) | 3 |
3 files changed, 36 insertions, 1 deletions
diff --git a/tests/pending/pos/t8230a.scala b/tests/pending/pos/t8230a.scala new file mode 100644 index 000000000..405aa86f5 --- /dev/null +++ b/tests/pending/pos/t8230a.scala @@ -0,0 +1,26 @@ +trait Arr[T] +object Arr { + def apply[T](xs: T): Arr[T] = null + def apply(x: Long) : Arr[Long] = null +} + +object I { + implicit def arrToTrav[T] (a: Arr[T]) : Traversable[T] = null + implicit def longArrToTrav(a: Arr[Long]): Traversable[Long] = null +} + +object Test { + def foo(t: Traversable[Any]) = {} + + object Okay { + Arr("1") + + import I.{ arrToTrav, longArrToTrav } + foo(Arr("2")) + } + + object Fail { + import I.arrToTrav + foo(Arr("3")) // found String, expected Long + } +} diff --git a/tests/pos/array-overload.scala b/tests/pos/array-overload.scala new file mode 100644 index 000000000..737ea0ec7 --- /dev/null +++ b/tests/pos/array-overload.scala @@ -0,0 +1,8 @@ +class Test { + object A { + def apply(x: Byte, xs: Byte*): Array[Byte] = ??? + def apply(x: Int, xs: Int*): Array[Int] = ??? + } + + val x: Array[Byte] = A.apply(1, 2) +} diff --git a/tests/pending/run/arrayclone-new.scala b/tests/run/arrayclone-new.scala index 5f09cd73a..8f66d1b31 100644 --- a/tests/pending/run/arrayclone-new.scala +++ b/tests/run/arrayclone-new.scala @@ -1,4 +1,4 @@ -import scala.reflect.{ClassTag, classTag} +import scala.reflect.ClassTag object Test extends dotty.runtime.LegacyApp{ BooleanArrayClone; @@ -106,3 +106,4 @@ object PolymorphicArrayClone{ testIt(mangled.it, 0, 1); } + |