diff options
author | Lukas Rytz <lukas.rytz@epfl.ch> | 2012-05-23 12:45:30 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@epfl.ch> | 2012-05-23 12:49:41 +0200 |
commit | 1952b9c5cde55aa619ba5b6c714d79db56e1986e (patch) | |
tree | d39bbe2ce0697357dcec1f63497c4c0aaf7b0aab /test/files/neg | |
parent | 94e5d76fb8632de1b6c34df63cb2bf3f1cd46fe3 (diff) | |
download | scala-1952b9c5cde55aa619ba5b6c714d79db56e1986e.tar.gz scala-1952b9c5cde55aa619ba5b6c714d79db56e1986e.tar.bz2 scala-1952b9c5cde55aa619ba5b6c714d79db56e1986e.zip |
more tests for SI-3761
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t3761-overload-byname.check | 13 | ||||
-rw-r--r-- | test/files/neg/t3761-overload-byname.scala | 13 |
2 files changed, 26 insertions, 0 deletions
diff --git a/test/files/neg/t3761-overload-byname.check b/test/files/neg/t3761-overload-byname.check new file mode 100644 index 0000000000..ae7d21dfa6 --- /dev/null +++ b/test/files/neg/t3761-overload-byname.check @@ -0,0 +1,13 @@ +t3761-overload-byname.scala:9: error: ambiguous reference to overloaded definition, +both method m1 in object t of type (x: => Int, s: Object)Int +and method m1 in object t of type (x: => AnyVal, s: String)Int +match argument types (Int,String) + m1(1, "") + ^ +t3761-overload-byname.scala:11: error: ambiguous reference to overloaded definition, +both method m2 in object t of type (x: => Int, s: Object)Int +and method m2 in object t of type (x: => Any, s: String)Int +match argument types (Int,String) + m2(1, "") + ^ +two errors found diff --git a/test/files/neg/t3761-overload-byname.scala b/test/files/neg/t3761-overload-byname.scala new file mode 100644 index 0000000000..5b9a381b93 --- /dev/null +++ b/test/files/neg/t3761-overload-byname.scala @@ -0,0 +1,13 @@ +object t { + def m1(x: => AnyVal, s: String) = 0 + def m1(x: => Int, s: Object) = 1 + + def m2(x: => Any, s: String) = 0 + def m2(x: => Int, s: Object) = 1 + + + m1(1, "") + m1(1d, "") + m2(1, "") + m2("", "") +} |