diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-05-19 02:25:40 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-05-19 02:25:40 -0700 |
commit | 423db24e1f4765d19351ed5b10b571252bcb717d (patch) | |
tree | 7bdcc212afbbc99fd0310b3e4c8929d67a697d63 /test/files/neg | |
parent | 8cb13b1017ef6ed8281964c51df48d4bb9dcaa99 (diff) | |
parent | da994bc9ce2cd9394ccb994fad677a6c67ad2759 (diff) | |
download | scala-423db24e1f4765d19351ed5b10b571252bcb717d.tar.gz scala-423db24e1f4765d19351ed5b10b571252bcb717d.tar.bz2 scala-423db24e1f4765d19351ed5b10b571252bcb717d.zip |
Merge pull request #577 from lrytz/wip/t2488
Fix SI-2488: allow named arg, in original position, before positionals
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t2488.check | 31 | ||||
-rw-r--r-- | test/files/neg/t2488.scala | 12 |
2 files changed, 43 insertions, 0 deletions
diff --git a/test/files/neg/t2488.check b/test/files/neg/t2488.check new file mode 100644 index 0000000000..170dbf88ff --- /dev/null +++ b/test/files/neg/t2488.check @@ -0,0 +1,31 @@ +t2488.scala:7: error: overloaded method value f with alternatives: + ()Int <and> + (a: Int,b: Int)Int + cannot be applied to (b: Int, Int) + println(c.f(b = 2, 2)) + ^ +t2488.scala:8: error: overloaded method value f with alternatives: + ()Int <and> + (a: Int,b: Int)Int + cannot be applied to (a: Int, c: Int) + println(c.f(a = 2, c = 2)) + ^ +t2488.scala:9: error: overloaded method value f with alternatives: + ()Int <and> + (a: Int,b: Int)Int + cannot be applied to (Int, c: Int) + println(c.f(2, c = 2)) + ^ +t2488.scala:10: error: overloaded method value f with alternatives: + ()Int <and> + (a: Int,b: Int)Int + cannot be applied to (c: Int, Int) + println(c.f(c = 2, 2)) + ^ +t2488.scala:11: error: overloaded method value f with alternatives: + ()Int <and> + (a: Int,b: Int)Int + cannot be applied to (Int) + println(c.f(2)) + ^ +5 errors found diff --git a/test/files/neg/t2488.scala b/test/files/neg/t2488.scala new file mode 100644 index 0000000000..8db052eec1 --- /dev/null +++ b/test/files/neg/t2488.scala @@ -0,0 +1,12 @@ +class C { + def f(a:Int, b:Int) = 1 + def f() = 2 +} +object Test extends App { + val c = new C() + println(c.f(b = 2, 2)) + println(c.f(a = 2, c = 2)) + println(c.f(2, c = 2)) + println(c.f(c = 2, 2)) + println(c.f(2)) +} |