testdata for IDEA-106848
authorAnna Kozlova <anna.kozlova@jetbrains.com>
Thu, 3 Sep 2015 15:40:02 +0000 (18:40 +0300)
committerAnna Kozlova <anna.kozlova@jetbrains.com>
Thu, 3 Sep 2015 17:30:59 +0000 (20:30 +0300)
java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/overloadResolution/StaticImportOfObjectsToString.java [new file with mode: 0644]
java/java-tests/testSrc/com/intellij/codeInsight/daemon/lambda/OverloadResolutionTest.java

diff --git a/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/overloadResolution/StaticImportOfObjectsToString.java b/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/lambda/overloadResolution/StaticImportOfObjectsToString.java
new file mode 100644 (file)
index 0000000..dd3da69
--- /dev/null
@@ -0,0 +1,17 @@
+
+import static java.util.Objects.toString;
+
+class Foo {
+
+  String go() {
+    return toString<error descr="'toString()' in 'Foo' cannot be applied to '(java.lang.String)'">("foo")</error>;
+  }
+
+  public String toString() {
+    return super.toString();
+  }
+
+  public static void main(String[] args) {
+    System.out.println(new Foo().go());
+  }
+}
\ No newline at end of file
index 590e197ab94143975934aec823993ba7c0caa3c6..a62fde6c82eda99a2c6d1ddce3a7445bb437e655 100644 (file)
@@ -138,6 +138,10 @@ public class OverloadResolutionTest extends LightDaemonAnalyzerTestCase {
     doTest();
   }
 
+  public void testStaticImportOfObjectsToString() throws Exception {
+    doTest();
+  }
+
   private void doTest() {
     doTest(true);
   }