diff options
author | Martin Odersky <odersky@gmail.com> | 2015-06-19 14:49:43 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-06-19 14:49:43 +0200 |
commit | faa7078fffb868c22f783388df0a6d80f64ee0c1 (patch) | |
tree | 4ca29a4e6581c7ebcc1feca2753b71d0588af936 /tests/pending/pos/t8230a.scala | |
parent | 631f7c1c9195c91e47403c9b1582f5f998ed2e66 (diff) | |
download | dotty-faa7078fffb868c22f783388df0a6d80f64ee0c1.tar.gz dotty-faa7078fffb868c22f783388df0a6d80f64ee0c1.tar.bz2 dotty-faa7078fffb868c22f783388df0a6d80f64ee0c1.zip |
Add failing test for #670.
Diffstat (limited to 'tests/pending/pos/t8230a.scala')
-rw-r--r-- | tests/pending/pos/t8230a.scala | 26 |
1 files changed, 26 insertions, 0 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 + } +} |