Package org.eclipse.jdt.internal.compiler.ast

Examples of org.eclipse.jdt.internal.compiler.ast.Invocation.binding()


    }
    if (expri instanceof FunctionalExpression) {
      c.add(new ConstraintExceptionFormula((FunctionalExpression) expri, substF));
    } else if (expri instanceof Invocation && expri.isPolyExpression()) {
      Invocation invocation = (Invocation) expri;
      MethodBinding innerMethod = invocation.binding(null, false, null);
      if (innerMethod instanceof ParameterizedGenericMethodBinding) {
        InferenceContext18 innerCtx = invocation.getInferenceContext((ParameterizedMethodBinding) innerMethod);
        if (innerCtx != null) { // otherwise innerMethod does not participate in inference
          return addConstraintsToC(invocation.arguments(), c, innerMethod.genericMethod(), innerCtx.inferenceKind);
        }
View Full Code Here


      if (inner instanceof Invocation) {
        Invocation innerMessage = (Invocation) inner;
        TypeBinding innerTargetType = inner.expectedType(); // may be set from acceptPendingPolyArguments
        if (innerTargetType != null && !innerTargetType.isProperType(true))
          innerTargetType = null;
        MethodBinding binding = innerMessage.binding(innerTargetType, innerTargetType != null, this.scope);
        if (binding == null)
          continue;
        MethodBinding original = binding.shallowOriginal();

        // apply inference results onto the allocation type of inner diamonds:
View Full Code Here

        targetType = Scope.substitute(substitution, targetType);
      Expression expression = this.invocationArguments[i];
      if (expression instanceof Invocation) {
        Invocation invocation = (Invocation) expression;
        if (!this.innerPolies.contains(invocation)) {
          MethodBinding method = invocation.binding(targetType, true, this.scope);
          if (method instanceof ParameterizedGenericMethodBinding) {
            ParameterizedGenericMethodBinding previousBinding = (ParameterizedGenericMethodBinding) method;
            InferenceContext18 innerCtx = invocation.getInferenceContext(previousBinding);
            if (innerCtx != null) {
              // we have a non-poly generic invocation, which needs inference but is not connected via innerPolis.
View Full Code Here

        // half-resolved diamond has a resolvedType, but that may not be the final word, try one more step of resolution:
              MethodBinding binding = ((AllocationExpression) this.left).binding(this.right, false, null);
              return (binding != null && binding.declaringClass.isCompatibleWith(this.right, inferenceContext.scope)) ? TRUE : FALSE;
            } else if (this.left instanceof Invocation && this.left.isPolyExpression()) {
              Invocation invoc = (Invocation) this.left;
              MethodBinding binding = invoc.binding(this.right, false, null);
              if (binding instanceof ParameterizedGenericMethodBinding) {
                ParameterizedGenericMethodBinding method = (ParameterizedGenericMethodBinding) binding;
          InferenceContext18 leftCtx = invoc.getInferenceContext(method);
                if (leftCtx.stepCompleted < InferenceContext18.TYPE_INFERRED) {
                  break proper; // fall through into nested inference below (not explicit in the spec!)
View Full Code Here

    } else {
      // shapes of poly expressions (18.2.1)
      // - parenthesized expression : these are transparent in our AST
      if (this.left instanceof Invocation) {
        Invocation invocation = (Invocation) this.left;
        MethodBinding previousMethod = invocation.binding(this.right, false, null);
        if (previousMethod == null)    // can happen, e.g., if inside a copied lambda with ignored errors
          return null;         // -> proceed with no new constraints
        MethodBinding method = previousMethod;
        // ignore previous (inner) inference result and do a fresh start:
        // avoid original(), since we only want to discard one level of instantiation
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.