Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ailabs-software/0fc4e939e0c9d31d46786053ebf061cb to your computer and use it in GitHub Desktop.
Save ailabs-software/0fc4e939e0c9d31d46786053ebf061cb to your computer and use it in GitHub Desktop.
Casting iterable to iterable of map of maps.
// Fails to work. Cast exception occurs as soon a value is accessed by key from one of the outer maps:
// e.g., iterable[0][outerKey] results in CastError
Map<Object, Map<Object, num> > reduceOpaqueIterable(Iterable<Object> windowValues)
{
return windowValues.map(
(inner) => (inner as Map).cast<Object, Map<Object, num> >() );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment