Skip to content

Commit 35cb5b8

Browse files
committed
Add neg test
1 parent 750aa50 commit 35cb5b8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/neg/i11899.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
3+
import java.util.function.Function
4+
5+
class Future[T](val initial: T) {
6+
def map[V](v: V): Unit = println(v)
7+
def map[U](fn: Function[T, U]): Unit = println(fn(initial))
8+
}
9+
10+
val f = new Future(42)
11+
val fn = (i: Int) => i.toString
12+
val x = f.map(fn) // error

0 commit comments

Comments
 (0)