コード例 #1
0
ファイル: BodyResolver.java プロジェクト: abond/kotlin
  private void resolveProperty(
      @NotNull BodiesResolveContext c,
      @Nullable LexicalScope parentScope,
      @NotNull JetProperty property,
      @NotNull PropertyDescriptor propertyDescriptor) {
    computeDeferredType(propertyDescriptor.getReturnType());

    JetExpression initializer = property.getInitializer();
    LexicalScope propertyScope = getScopeForProperty(c, property);
    if (parentScope == null) {
      parentScope = propertyScope;
    }
    if (initializer != null) {
      resolvePropertyInitializer(
          c.getOuterDataFlowInfo(), property, propertyDescriptor, initializer, propertyScope);
    }

    JetExpression delegateExpression = property.getDelegateExpression();
    if (delegateExpression != null) {
      assert initializer == null
          : "Initializer should be null for delegated property : " + property.getText();
      resolvePropertyDelegate(
          c.getOuterDataFlowInfo(),
          property,
          propertyDescriptor,
          delegateExpression,
          parentScope,
          propertyScope);
    }

    resolvePropertyAccessors(c, property, propertyDescriptor);
  }