You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
try {
var sourceMap =<String, String>{'a':'A'};
var canonicalized =newCanonicalizedMap<String, String, String>.from(sourceMap, (String key) => key.toLowerCase());
var badResult = canonicalized.cast<String, String>();
var goodResult =Map.of(canonicalized).cast<String, String>();
print(goodResult); // {a: A}print(badResult ); // _CastError: type 'MapEntry<String, String>' is not a subtype of type 'String' in type cast
} catch(e, s) {
print('Unhandled Exception: ${e.runtimeType}: $e\n$s');
}
Expected Result:
Calling .cast() should not throw in this circumstance
The text was updated successfully, but these errors were encountered:
lrhn
added
the
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
label
Sep 9, 2022
CanonicalizedMap.cast() throws _CastError
Example:
Expected Result:
Calling
.cast()
should not throw in this circumstanceThe text was updated successfully, but these errors were encountered: