IDEA-67625 Dynamic properties and methods have Object type instead of unresolved ones

This commit is contained in:
Maxim.Medvedev
2012-04-06 17:29:08 +04:00
parent 1dd1335a4e
commit 28541a3a42
2 changed files with 13 additions and 3 deletions
@@ -143,11 +143,11 @@ public class GrDynamicImplicitMethod extends LightElement implements PsiMethod,
}
public PsiType getReturnType() {
final PsiType typeElement = myMethod.getReturnType();
if (typeElement == null) {
final PsiType type = myMethod.getReturnType();
if (type == null || type instanceof PsiClassType && ((PsiClassType)type).resolve() == null) {
return TypesUtil.getJavaLangObject(myMethod);
}
return typeElement;
return type;
}
public PsiTypeElement getReturnTypeElement() {
@@ -192,4 +192,14 @@ public class GrDynamicImplicitProperty extends GrImplicitVariableImpl implements
public void setInitializer(@Nullable PsiExpression initializer) throws IncorrectOperationException {
throw new IncorrectOperationException();
}
@NotNull
@Override
public PsiType getType() {
PsiType type = super.getType();
if (type instanceof PsiClassType && ((PsiClassType)type).resolve() == null) {
return PsiType.getJavaLangObject(myManager, getResolveScope());
}
return type;
}
}