Skip to content

Commit faa7078

Browse files
committed
Add failing test for scala#670.
1 parent 631f7c1 commit faa7078

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

tests/pending/pos/t8230a.scala

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
trait Arr[T]
2+
object Arr {
3+
def apply[T](xs: T): Arr[T] = null
4+
def apply(x: Long) : Arr[Long] = null
5+
}
6+
7+
object I {
8+
implicit def arrToTrav[T] (a: Arr[T]) : Traversable[T] = null
9+
implicit def longArrToTrav(a: Arr[Long]): Traversable[Long] = null
10+
}
11+
12+
object Test {
13+
def foo(t: Traversable[Any]) = {}
14+
15+
object Okay {
16+
Arr("1")
17+
18+
import I.{ arrToTrav, longArrToTrav }
19+
foo(Arr("2"))
20+
}
21+
22+
object Fail {
23+
import I.arrToTrav
24+
foo(Arr("3")) // found String, expected Long
25+
}
26+
}

0 commit comments

Comments
 (0)