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

Method resolveType

src/main/java/net/starlark/java/syntax/Resolver.java:977–988  ·  view source on GitHub ↗
(Resolver.Module module, Expression expr)

Source from the content-addressed store, hash-verified

975 }
976
977 public StarlarkType resolveType(Resolver.Module module, Expression expr) {
978 Object typeOrArg = resolveTypeOrArg(module, expr);
979 if (!(typeOrArg instanceof StarlarkType type)) {
980 if (typeOrArg instanceof Types.TypeConstructorProxy) {
981 errorf(expr, "expected type arguments after the type constructor '%s'", expr);
982 } else {
983 errorf(expr, "expression '%s' is not a valid type.", expr);
984 }
985 return Types.ANY;
986 }
987 return type;
988 }
989
990 /**
991 * Resolves a type expression to a {@link StarlarkType}.

Callers 3

resolveTypeMethod · 0.95
resolveTypeOrArgMethod · 0.95
resolveFunctionTypeMethod · 0.95

Calls 3

resolveTypeOrArgMethod · 0.95
errorfMethod · 0.95
isEmptyMethod · 0.45

Tested by 1

resolveTypeMethod · 0.76