Errors thrown from runZonedExperimental's onDone handler are crazy confusing. #11969
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
closed-duplicate
Closed in favor of an existing report
The following code snippet:
var nul;
var c;
runZonedExperimental(() {
c = new Completer.sync();
c.future.then((_) {});
}, onDone: () => nul.sad());
c.complete("ss");
produces an error:
Caught 'dart:async/zone.dart': Failed assertion: line 115 pos 12: '! _children.isEmpty' is not true.
_ZoneBase._removeChild dart:async/zone.dart 115:12
_ZoneBase._dispose dart:async/zone.dart 48:31
_WaitForCompletionZone._dispose dart:async/zone.dart 169:19
_ZoneBase._checkIfDone dart:async/zone.dart 53:15
_ZoneBase._runInZone dart:async/zone.dart 95:19
_ZoneBase._runUnguarded dart:async/zone.dart 102:22
_ZoneBase.executeCallback dart:async/zone.dart 58:23
_TransformFuture._sendValue dart:async/future_impl.dart 350:26
_FutureImpl._setValueUnchecked dart:async/future_impl.dart 186:26
_FutureImpl._setValue dart:async/future_impl.dart 176:23
_SyncCompleter._setFutureValue dart:async/future_impl.dart 50:21
_Completer.complete dart:async/future_impl.dart 17:20
main.<anonymous closure>.<anonymous closure> /home/deboer/github/angular-dart/test/http_spec.dart 119:17 (e.g. the c.complete() call)
when it should throw an error like:
The null object does not have a method 'sad'.
NoSuchMethodError : method not found: 'sad'
Receiver: null
Arguments: []
0 Object.noSuchMethod (dart:core-patch/object_patch.dart:19:25)
1 main.<anonymous closure>.<anonymous closure>.<anonymous closure> (http://localhost:9876/base/test/http_spec.dart:116:36)
2 _WaitForCompletionZone._dispose (dart:async/zone.dart:170:12)
3 _ZoneBase._checkIfDone (dart:async/zone.dart:53:15)
4 _ZoneBase._runInZone (dart:async/zone.dart:95:19)
The text was updated successfully, but these errors were encountered: