MCPcopy Create free account
hub / github.com/bazelbuild/bazel / union

Method union

src/main/java/net/starlark/java/types/Types.java:351–353  ·  view source on GitHub ↗

Constructs a union type. If the types sets contains another Union type it's flattened. Duplicates are removed. If types set contains Object type it's simplified to Object type. If the set contains a single element, it is returned instead of constructing a union. @throws IllegalArgumentExcep

(StarlarkType... types)

Source from the content-addressed store, hash-verified

349 * @throws IllegalArgumentException If an empty set is passed in.
350 */
351 public static StarlarkType union(StarlarkType... types) {
352 return union(ImmutableSet.copyOf(types));
353 }
354
355 /** Constructs a union type. */
356 public static StarlarkType union(ImmutableSet<StarlarkType> types) {

Callers 11

resolveType_unionMethod · 0.95
isSubtypeOf_unionMethod · 0.95
resolveTypeOrArgMethod · 0.95
fromAnnotationMethod · 0.95
getStarlarkTypeMethod · 0.95
buildStarlarkTypeMethod · 0.95
getStarlarkTypeMethod · 0.95
getStarlarkTypeMethod · 0.95
getSupertypesMethod · 0.45
mock_openFunction · 0.45

Calls 11

getTypesMethod · 0.80
copyOfMethod · 0.45
builderMethod · 0.45
addAllMethod · 0.45
addMethod · 0.45
buildMethod · 0.45
containsMethod · 0.45
sizeMethod · 0.45
nextMethod · 0.45
iteratorMethod · 0.45
isEmptyMethod · 0.45

Tested by 2

resolveType_unionMethod · 0.76
isSubtypeOf_unionMethod · 0.76