From edf3a54ed5bf82af5b0b768f0d617e995f455b4f Mon Sep 17 00:00:00 2001 From: "Maxim.Medvedev" Date: Tue, 19 Jun 2012 14:58:27 +0400 Subject: [PATCH] IDEA-86929 Smart completion in "new " statement --- .../lang/psi/expectedTypes/GroovyExpectedTypesProvider.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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)}; } }