type<T> static method
Implementation
static void type<T>(Value? val, [String? desc]) {
if (val is! T) {
String typeStr = val == null ? "null" : "a ${val.runtimeType}";
throw TypeException(
"got $typeStr where a ${typeToString<T>(val as T)} was required${desc == null ? '' : ' ($desc)'}",
);
}
}