closure
319
Anomaly identified by the detector. Please review whether this anomaly corresponds to a misuse.
2
com/google/javascript/rhino/jstype/UnionTypeBuilder.java
reduceAlternatesWithoutUnion()
class UnionTypeBuilder { /** * Reduce the alternates into a non-union type. * If the alternates can't be accurately represented with a non-union * type, return null. */ private JSType reduceAlternatesWithoutUnion() { if (isAllType) { return registry.getNativeType(ALL_TYPE); } else if (isNativeUnknownType) { if (areAllUnknownsChecked) { return registry.getNativeType(CHECKED_UNKNOWN_TYPE); } else { return registry.getNativeType(UNKNOWN_TYPE); } } else { int size = alternates.size(); if (size > MAX_UNION_SIZE) { return registry.getNativeType(UNKNOWN_TYPE); } else if (size > 1) { return null; } else if (size == 1) { return alternates.iterator().next(); } else { return registry.getNativeType(NO_TYPE); } } } }
0.98
45.15
Iterator.hasNext () : boolean @ (0) < Iterator.next () : Object @ (0)
47
RETVAL: Iterator.next () : Object < CAST: JSType
The size check ensures this works.