Example usage for org.eclipse.jdt.internal.compiler.lookup TypeBinding isCompatibleWith

List of usage examples for org.eclipse.jdt.internal.compiler.lookup TypeBinding isCompatibleWith

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.lookup TypeBinding isCompatibleWith.

Prototype

public abstract boolean isCompatibleWith(TypeBinding right,  Scope scope);

Source Link

Usage

From source file:org.eclipse.objectteams.otdt.internal.core.compiler.lifting.ArrayLowering.java

License:Open Source License

public MethodBinding ensureTransformMethod(BlockScope scope, Expression teamExpr, TypeBinding providedType,
        TypeBinding requiredType, boolean isLifting) {
    TypeBinding providedLeaf = providedType.leafComponentType();
    TypeBinding matchingBase = ((ReferenceBinding) providedLeaf).baseclass();
    TypeBinding requiredLeaf = requiredType.leafComponentType();
    if (TypeBinding.notEquals(matchingBase, requiredLeaf)
            && matchingBase.isCompatibleWith(requiredLeaf, scope)) {
        requiredType = scope.environment().createArrayType(matchingBase, requiredType.dimensions());
    }//from ww  w  .j  a v  a 2s  .c om
    return super.ensureTransformMethod(scope, teamExpr, providedType, requiredType, isLifting);
}