diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/expectedTypes/GroovyExpectedTypesProvider.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/expectedTypes/GroovyExpectedTypesProvider.java index e33b7c2684c0..56411b427de7 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/expectedTypes/GroovyExpectedTypesProvider.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/expectedTypes/GroovyExpectedTypesProvider.java @@ -151,10 +151,8 @@ public class GroovyExpectedTypesProvider { public void visitVariable(GrVariable variable) { if (myExpression.equals(variable.getInitializerGroovy())) { - PsiType type = variable.getDeclaredType(); - if (type != null) { - myResult = new TypeConstraint[]{new SubtypeConstraint(type, type)}; - } + PsiType type = variable.getType(); + myResult = new TypeConstraint[]{new SubtypeConstraint(type, type)}; } }