Skip to content

Instantly share code, notes, and snippets.

@zolotyh
Created June 22, 2018 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zolotyh/5ae88dfdcc442cf65e405333180bb35c to your computer and use it in GitHub Desktop.
Save zolotyh/5ae88dfdcc442cf65e405333180bb35c to your computer and use it in GitHub Desktop.
cast problem
import 'dart:async';
import 'dart:collection';
void main(){
final completer = new Completer<dynamic>();
final future = completer.future;
future.then((dynamic result){
print('before error');
LinkedHashSet set = (result as LinkedHashSet).cast<String>();
print('after error');
});
new Timer(const Duration(milliseconds: 400), (){
completer.complete(new LinkedHashSet<String>());
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment