| 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}. |