@Override public Iterable<ObjectType> getCtorExtendedInterfaces() { return this.referencedObjType == null ? Collections.<ObjectType>emptyList() : this.referencedObjType.getCtorExtendedInterfaces(); }
/** * Returns the secondary parents of this property map, for interfaces that * need multiple inheritance. */ private Iterable<ObjectType> getSecondaryParentObjects() { if (parentSource == null) { return ImmutableList.of(); } return parentSource.getCtorExtendedInterfaces(); }
/** * Returns the secondary parents of this property map, for interfaces that * need multiple inheritance. */ Iterable<PropertyMap> getSecondaryParents() { if (parentSource == null) { return ImmutableList.of(); } Iterable<ObjectType> extendedInterfaces = parentSource.getCtorExtendedInterfaces(); // Most of the time, this will be empty. if (Iterables.isEmpty(extendedInterfaces)) { return ImmutableList.of(); } return Iterables.transform(extendedInterfaces, PROP_MAP_FROM_TYPE); }
/** * Detects cycles in either the implicit prototype chain, or the implemented/extended * interfaces.<p> * * @return True iff a cycle was detected. */ final boolean detectInheritanceCycle() { // TODO(dimvar): This should get moved to preventing cycles in FunctionTypeBuilder // rather than removing them here after they have been created. // Also, this doesn't do the right thing for extended interfaces, though that is // masked by another bug. return detectImplicitPrototypeCycle() || Iterables.contains(this.getCtorImplementedInterfaces(), this) || Iterables.contains(this.getCtorExtendedInterfaces(), this); }
@Override public Iterable<ObjectType> getCtorExtendedInterfaces() { LinkedHashSet<ObjectType> resolvedExtendedInterfaces = new LinkedHashSet<>(); for (ObjectType obj : getReferencedObjTypeInternal().getCtorExtendedInterfaces()) { resolvedExtendedInterfaces.add(obj.visit(replacer).toObjectType()); } return resolvedExtendedInterfaces; }
private void addRelatedInterfaces(ObjectType instance, Set<ObjectType> interfaces) { FunctionType constructor = instance.getConstructor(); if (constructor != null && constructor.isInterface() && !interfaces.contains(instance)) { interfaces.add(instance); for (ObjectType interfaceType : instance.getCtorExtendedInterfaces()) { addRelatedInterfaces(interfaceType, interfaces); } } }
private void addRelatedInterfaces(ObjectType instance, Set<ObjectType> set) { FunctionType constructor = instance.getConstructor(); if (constructor != null) { if (!constructor.isInterface()) { return; } if (!set.add(instance)) { return; } for (ObjectType interfaceType : instance.getCtorExtendedInterfaces()) { addRelatedInterfaces(interfaceType, set); } } }
private void addRelatedInterfaces(ObjectType instance, Set<ObjectType> set) { FunctionType constructor = instance.getConstructor(); if (constructor != null) { if (!constructor.isInterface()) { return; } if (!set.add(instance)) { return; } for (ObjectType interfaceType : instance.getCtorExtendedInterfaces()) { addRelatedInterfaces(interfaceType, set); } } }
public final ObjectType getTopDefiningInterface(String propertyName) { ObjectType foundType = null; if (hasProperty(propertyName)) { foundType = this; } for (ObjectType interfaceType : getCtorExtendedInterfaces()) { if (interfaceType.hasProperty(propertyName)) { foundType = interfaceType.getTopDefiningInterface(propertyName); } } return foundType; }
/** * Given an interface and a property, finds the top-most super interface * that has the property defined (including this interface). */ public static ObjectType getTopDefiningInterface(ObjectType type, String propertyName) { ObjectType foundType = null; if (type.hasProperty(propertyName)) { foundType = type; } for (ObjectType interfaceType : type.getCtorExtendedInterfaces()) { if (interfaceType.hasProperty(propertyName)) { foundType = getTopDefiningInterface(interfaceType, propertyName); } } return foundType; }
/** * We treat this as the unknown type if any of its implicit prototype * properties is unknown. */ @Override public boolean isUnknownType() { // If the object is unknown now, check the supertype again, // because it might have been resolved since the last check. if (unknown) { ObjectType implicitProto = getImplicitPrototype(); if (implicitProto == null || implicitProto.isNativeObjectType()) { unknown = false; for (ObjectType interfaceType : getCtorExtendedInterfaces()) { if (interfaceType.isUnknownType()) { unknown = true; break; } } } else { unknown = implicitProto.isUnknownType(); } } return unknown; }
/** * We treat this as the unknown type if any of its implicit prototype * properties is unknown. */ @Override public boolean isUnknownType() { // If the object is unknown now, check the supertype again, // because it might have been resolved since the last check. if (unknown) { ObjectType implicitProto = getImplicitPrototype(); if (implicitProto == null || implicitProto.isNativeObjectType()) { unknown = false; for (ObjectType interfaceType : getCtorExtendedInterfaces()) { if (interfaceType.isUnknownType()) { unknown = true; break; } } } else { unknown = implicitProto.isUnknownType(); } } return unknown; }
for (ObjectType iType : interfaceType.getCtorExtendedInterfaces()) { checkInterfaceConflictProperties(t, n, functionName, properties, currentProperties, iType);
for (ObjectType iType : interfaceType.getCtorExtendedInterfaces()) { checkInterfaceConflictProperties(t, n, functionName, properties, currentProperties, iType);