summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2013-05-29 11:11:53 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2013-05-29 11:11:53 -0700
commit681f2070053bc6f3133425b44083fe056bfeb1fa (patch)
treee323a02495327e40aa12fac2d3a7b29bb40a4b76 /test/files
parent9eb63c522fc3f490ff8ff3e731dca1e160a0338f (diff)
parentb941551529e40fc7d71cf25e1ad904ab7badd14c (diff)
downloadscala-681f2070053bc6f3133425b44083fe056bfeb1fa.tar.gz
scala-681f2070053bc6f3133425b44083fe056bfeb1fa.tar.bz2
scala-681f2070053bc6f3133425b44083fe056bfeb1fa.zip
Merge pull request #2578 from retronym/ticket/6138
SI-6138 Centralize and refine detection of `getClass` calls
Diffstat (limited to 'test/files')
-rw-r--r--test/files/neg/t6138.check7
-rw-r--r--test/files/neg/t6138.scala5
2 files changed, 12 insertions, 0 deletions
diff --git a/test/files/neg/t6138.check b/test/files/neg/t6138.check
new file mode 100644
index 0000000000..8fd9978248
--- /dev/null
+++ b/test/files/neg/t6138.check
@@ -0,0 +1,7 @@
+t6138.scala:4: error: ambiguous reference to overloaded definition,
+both method getClass in object definitions of type (s: Int)Any
+and method getClass in object definitions of type (s: String)Any
+match argument types (Nothing)
+ getClass(???): String
+ ^
+one error found
diff --git a/test/files/neg/t6138.scala b/test/files/neg/t6138.scala
new file mode 100644
index 0000000000..2f45a46b1c
--- /dev/null
+++ b/test/files/neg/t6138.scala
@@ -0,0 +1,5 @@
+object definitions {
+ def getClass(s: String): Any = ???
+ def getClass(s: Int): Any = ???
+ getClass(???): String
+}