@Override public boolean sameType(TypeUsage other) { if (!other.isReferenceTypeUsage()) { return false; } return getQualifiedName().equals(other.asReferenceTypeUsage().getQualifiedName()); }
@Override public boolean canBeAssignedTo(TypeUsage type) { if (!type.isReferenceTypeUsage()) { return false; } ReferenceTypeUsage other = type.asReferenceTypeUsage(); if (this.getQualifiedName().equals(other.getQualifiedName())) { return true; } for (TypeUsage ancestor : this.getAllAncestors()) { if (ancestor.canBeAssignedTo(type)) { return true; } } return false; }