IDEA-56795 Groovy method does not resolve

This commit is contained in:
Maxim Medvedev
2010-07-27 13:52:32 +04:00
parent 1b28cabde8
commit 9ada5b4924
5 changed files with 24 additions and 2 deletions
@@ -71,7 +71,7 @@ public class GppTypeConverter extends GrTypeConverter {
return true;
}
if (hasDefaultConstructor(lType)) {
if (!isMethodCallConversion(context) && hasDefaultConstructor(lType)) {
return true;
}
}
@@ -109,6 +109,8 @@ public class GrMapType extends GrLiteralClassType {
}
public String getInternalCanonicalText() {
if (myStringEntries.size() == 0) return "[:]";
List<String> components = new ArrayList<String>();
for (String s : myStringEntries.keySet()) {
components.add("'" + s + "':" + getInternalCanonicalText(myStringEntries.get(s)));
@@ -68,7 +68,7 @@ public class GroovyHighlightingTest extends LightCodeInsightFixtureTestCase {
doTest();
}
private void doTest(LocalInspectionTool... tools) throws Exception {
private void doTest(LocalInspectionTool... tools) {
myFixture.enableInspections(tools);
myFixture.testHighlighting(true, false, false, getTestName(false) + ".groovy");
}
@@ -280,4 +280,8 @@ public class GroovyHighlightingTest extends LightCodeInsightFixtureTestCase {
}
public void testNumberDuplicatesInMaps() throws Exception {doTest();}
public void testMapNotAcceptedAsStringParameter() {
doTest();
}
}
@@ -0,0 +1,7 @@
class A {
void method(String m) {}
{
method<warning descr="'method' in 'A' cannot be applied to '([:])'">([:])</warning>
}
}
@@ -0,0 +1,9 @@
class A {
void method(Map m, Closure e ) {}
void method(String m) {}
{
meth<ref>od([:])
}
}