public TypeBinding resolveType(BlockScope scope) {
    // Propagate the type checking to the arguments, and check if the constructor is defined.
    constant = Constant.NotAConstant;
    if (this.member != null) {
      this.resolvedType = this.member.resolveForAllocation(scope, this);
      if (this.resolvedType != null && !this.resolvedType.isValidBinding()) {
        scope.problemReporter().invalidType(this, this.resolvedType);
      }
    } else if (this.type == null) {
      // initialization of an enum constant
      this.resolvedType = scope.enclosingReceiverType();
    } else {
      this.resolvedType = this.type.resolveType(scope, true /* check bounds*/);
    }
    // will check for null after args are resolved
    // buffering the arguments' types
    boolean argsContainCast = false;
    TypeBinding[] argumentTypes = Binding.NO_PARAMETERS;
    if (arguments != null) {
      boolean argHasError = false;
      int length = arguments.length;
      argumentTypes = new TypeBinding[length];
      for (int i = 0; i < length; i++) {
        Expression argument = this.arguments[i];
        if ((argumentTypes[i] = argument.resolveType(scope)) == null) {
          argHasError = true;
          argumentTypes[i] = TypeBinding.UNKNOWN;
        }
      }
      if (argHasError) {
        //			if (this.resolvedType instanceof ReferenceBinding) {
        //				// record a best guess, for clients who need hint about possible contructor match
        //				TypeBinding[] pseudoArgs = new TypeBinding[length];
        //				for (int i = length; --i >= 0;)
        //					pseudoArgs[i] = argumentTypes[i] == null ? this.resolvedType : argumentTypes[i]; //
        // replace args with errors with receiver
        //				this.binding = scope.findMethod((ReferenceBinding) this.resolvedType,
        // TypeConstants.INIT, pseudoArgs, this);
        //			}
        //			return this.resolvedType;
      }
    }
    if (this.resolvedType == null
        || this.resolvedType.isAnyType()
        || this.resolvedType instanceof ProblemReferenceBinding) {
      this.binding =
          new ProblemMethodBinding(
              TypeConstants.INIT, Binding.NO_PARAMETERS, ProblemReasons.NotFound);
      this.resolvedType = TypeBinding.UNKNOWN;
      return this.resolvedType;
    }

    if (!this.resolvedType.isValidBinding()) return null;
    if (this.resolvedType instanceof ReferenceBinding) {
      ReferenceBinding allocationType = (ReferenceBinding) this.resolvedType;
      if (!(binding = scope.getConstructor(allocationType, argumentTypes, this)).isValidBinding()) {
        if (binding.declaringClass == null) binding.declaringClass = allocationType;
        scope.problemReporter().invalidConstructor(this, binding);
        return this.resolvedType;
      }
      if (argumentTypes.length != binding.parameters.length)
        scope.problemReporter().wrongNumberOfArguments(this, binding);
      if (isMethodUseDeprecated(binding, scope, true))
        scope.problemReporter().deprecatedMethod(binding, this);
      checkInvocationArguments(
          scope,
          null,
          allocationType,
          this.binding,
          this.arguments,
          argumentTypes,
          argsContainCast,
          this);
    }

    return this.resolvedType;
  }