diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/t5969.check | 7 | ||||
-rw-r--r-- | test/files/neg/t5969.scala | 11 | ||||
-rw-r--r-- | test/files/neg/t649.check | 2 |
3 files changed, 19 insertions, 1 deletions
diff --git a/test/files/neg/t5969.check b/test/files/neg/t5969.check new file mode 100644 index 0000000000..9d8ac9a3a5 --- /dev/null +++ b/test/files/neg/t5969.check @@ -0,0 +1,7 @@ +t5969.scala:9: error: overloaded method value g with alternatives: + (x: C2)String <and> + (x: C1)String + cannot be applied to (String) + if (false) List(g(x)) else List[C1]() map g + ^ +one error found diff --git a/test/files/neg/t5969.scala b/test/files/neg/t5969.scala new file mode 100644 index 0000000000..62f87fd7ab --- /dev/null +++ b/test/files/neg/t5969.scala @@ -0,0 +1,11 @@ +class C1 +class C2 +class A { + def f(x: Any) = x + def g(x: C1): String = "A" + def g(x: C2): String = "B" + + def crash() = f(List[String]() flatMap { x => + if (false) List(g(x)) else List[C1]() map g + }) +} diff --git a/test/files/neg/t649.check b/test/files/neg/t649.check index a6670886b5..5a270d4751 100644 --- a/test/files/neg/t649.check +++ b/test/files/neg/t649.check @@ -1,4 +1,4 @@ t649.scala:3: error: overloaded method foo needs result type def foo[A] = foo[A] - ^ + ^ one error found |