Implemented compacting type names and adding valid imports in override/implements handler.

#KT-1602 fixed
This commit is contained in:
Evgeny Gerashchenko
2012-05-02 13:47:21 +04:00
parent 298d98ee12
commit 2fcc7b0cbb
5 changed files with 91 additions and 16 deletions
@@ -61,6 +61,7 @@ public interface BindingContext {
WritableSlice<JetExpression, JetType> AUTOCAST = Slices.createSimpleSlice();
/** A scope where type of expression has been resolved */
WritableSlice<JetTypeReference, JetScope> TYPE_RESOLUTION_SCOPE = Slices.createSimpleSlice();
WritableSlice<JetExpression, JetScope> RESOLUTION_SCOPE = Slices.createSimpleSlice();
/** Collected during analyze, used in IDE in auto-cast completion */
@@ -69,6 +69,7 @@ public class TypeResolver {
JetTypeElement typeElement = typeReference.getTypeElement();
JetType type = resolveTypeElement(scope, annotations, typeElement, false, trace, checkBounds);
trace.record(BindingContext.TYPE, typeReference, type);
trace.record(BindingContext.TYPE_RESOLUTION_SCOPE, typeReference, scope);
return type;
}
@@ -472,6 +472,9 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
if (result != null) {
context.trace.record(BindingContext.EXPRESSION_TYPE, expression.getInstanceReference(), result);
context.trace.record(BindingContext.REFERENCE_TARGET, expression.getInstanceReference(), result.getConstructor().getDeclarationDescriptor());
if (superTypeQualifier != null) {
context.trace.record(BindingContext.TYPE_RESOLUTION_SCOPE, superTypeQualifier, context.scope);
}
}
}
return DataFlowUtils.checkType(result, expression, context);