for( Type compType: ((Type.IntersectionClassType)type).getComponents() )
private boolean giveWarning(Type from, Type to) { List<Type> bounds = to.isCompound() ? ((IntersectionClassType)to.unannotatedType()).getComponents() : List.of(to); for (Type b : bounds) { Type subFrom = asSub(from, b.tsym); if (b.isParameterized() && (!(isUnbounded(b) || isSubtype(from, b) || ((subFrom != null) && containsType(b.allparams(), subFrom.allparams()))))) { return true; } } return false; }
private boolean giveWarning(Type from, Type to) { List<Type> bounds = to.isCompound() ? ((IntersectionClassType)to.unannotatedType()).getComponents() : List.of(to); for (Type b : bounds) { Type subFrom = asSub(from, b.tsym); if (b.isParameterized() && (!(isUnbounded(b) || isSubtype(from, b) || ((subFrom != null) && containsType(b.allparams(), subFrom.allparams()))))) { return true; } } return false; }
boolean visitIntersectionType(IntersectionClassType ict, Type s, boolean reverse) { Warner warn = noWarnings; for (Type c : ict.getComponents()) { warn.clear(); if (reverse ? !isCastable(s, c, warn) : !isCastable(c, s, warn)) return false; } if (warn.hasLint(LintCategory.UNCHECKED)) warnStack.head.warn(LintCategory.UNCHECKED); return true; }
public void visitIntersectionClassType(Type.IntersectionClassType type) { for (Type component : type.getComponents()) { component.accept(this, null); } }
public List<Type> getExplicitComponents() { return allInterfaces ? interfaces_field : getComponents(); }
boolean visitIntersectionType(IntersectionClassType ict, Type s, boolean reverse) { Warner warn = noWarnings; for (Type c : ict.getComponents()) { warn.clear(); if (reverse ? !isCastable(s, c, warn) : !isCastable(c, s, warn)) return false; } if (warn.hasLint(LintCategory.UNCHECKED)) warnStack.head.warn(LintCategory.UNCHECKED); return true; }
public List<Type> getExplicitComponents() { return allInterfaces ? interfaces_field : getComponents(); }
@Override public Choice<Unifier> visitClassType(ClassType t, Unifier unifier) { if (t instanceof IntersectionClassType) { IntersectionClassType intersection = (IntersectionClassType) t; return unifyList(unifier, bounds(), intersection.getComponents()); } return Choice.none(); } }
public void visitIntersectionClassType(Type.IntersectionClassType type) { for (Type component : type.getComponents()) { component.accept(this, null); } }
@Override public Choice<Unifier> visitClassType(ClassType t, Unifier unifier) { if (t instanceof IntersectionClassType) { IntersectionClassType intersection = (IntersectionClassType) t; return unifyList(unifier, bounds(), intersection.getComponents()); } return Choice.none(); } }