include anonym prefix in internal canonical text to avoid incompatibility messages with "same" types on both sides

This commit is contained in:
Anna Kozlova
2014-05-22 20:45:58 +04:00
parent 5953b8fb0d
commit 506a2cbbbc
5 changed files with 7 additions and 4 deletions
@@ -184,6 +184,9 @@ public class PsiImmediateClassType extends PsiClassType.Stub {
ClassResolveResult baseResolveResult = ((PsiAnonymousClass)aClass).getBaseClassType().resolveGenerics();
PsiClass baseClass = baseResolveResult.getElement();
if (baseClass != null) {
if (textType == TextType.INT_CANONICAL) {
buffer.append("anonymous ");
}
buildText(baseClass, baseResolveResult.getSubstitutor(), buffer, textType, false);
}
return;
@@ -87,7 +87,7 @@ class e {
class ccc {
static Comparable<? super ccc> f() {
return <warning descr="Unchecked assignment: 'java.lang.Comparable' to 'java.lang.Comparable<? super ccc>'">new Comparable () {
return <warning descr="Unchecked assignment: 'anonymous java.lang.Comparable' to 'java.lang.Comparable<? super ccc>'">new Comparable () {
public int compareTo(final Object o) {
return 0;
}
@@ -16,7 +16,7 @@ class Test {
}
public static <C extends String> IConverter<C> getConverter1(Class<C> type) {
return <error descr="Inconvertible types; cannot cast 'DoubleConverter' to 'IConverter<C>'">(IConverter<C>)new DoubleConverter() {
return <error descr="Inconvertible types; cannot cast 'anonymous DoubleConverter' to 'IConverter<C>'">(IConverter<C>)new DoubleConverter() {
}</error>;
}
@@ -87,7 +87,7 @@ class e {
class ccc {
static Comparable<? super ccc> f() {
return <warning descr="Unchecked assignment: 'java.lang.Comparable' to 'java.lang.Comparable<? super ccc>'">new Comparable () {
return <warning descr="Unchecked assignment: 'anonymous java.lang.Comparable' to 'java.lang.Comparable<? super ccc>'">new Comparable () {
public int compareTo(final Object o) {
return 0;
}
@@ -16,7 +16,7 @@ class Test {
}
public static <C extends String> IConverter<C> getConverter1(Class<C> type) {
return <error descr="Inconvertible types; cannot cast 'DoubleConverter' to 'IConverter<C>'">(IConverter<C>)new DoubleConverter() {
return <error descr="Inconvertible types; cannot cast 'anonymous DoubleConverter' to 'IConverter<C>'">(IConverter<C>)new DoubleConverter() {
}</error>;
}