public final boolean hasEqualCallType(FunctionType otherType) { return this.call.checkArrowEquivalenceHelper( otherType.call, EquivalenceMethod.IDENTITY, EqCache.create()); }
public boolean hasEqualCallType(FunctionType otherType) { return this.call.checkArrowEquivalenceHelper( otherType.call, EquivalenceMethod.IDENTITY, EqCache.create()); }
/** * Two function types are equal if their signatures match. Since they don't have signatures, two * interfaces are equal if their names match. */ final boolean checkFunctionEquivalenceHelper( FunctionType that, EquivalenceMethod eqMethod, EqCache eqCache) { if (this == that) { return true; } if (kind != that.kind) { return false; } switch (kind) { case CONSTRUCTOR: return false; // constructors use identity semantics, which we already checked for above. case INTERFACE: return getReferenceName().equals(that.getReferenceName()); case ORDINARY: return typeOfThis.checkEquivalenceHelper(that.typeOfThis, eqMethod, eqCache) && call.checkArrowEquivalenceHelper(that.call, eqMethod, eqCache); default: throw new AssertionError(); } }
/** * Two function types are equal if their signatures match. Since they don't * have signatures, two interfaces are equal if their names match. */ boolean checkFunctionEquivalenceHelper( FunctionType that, EquivalenceMethod eqMethod, EqCache eqCache) { if (isConstructor()) { if (that.isConstructor()) { return this == that; } return false; } if (isInterface()) { if (that.isInterface()) { return getReferenceName().equals(that.getReferenceName()); } return false; } if (that.isInterface()) { return false; } return typeOfThis.checkEquivalenceHelper(that.typeOfThis, eqMethod, eqCache) && call.checkArrowEquivalenceHelper(that.call, eqMethod, eqCache); }