Description
This issue was originally filed by [email protected]
What steps will reproduce the problem?
- Paste code below into new dart script - test_isolate.dart:
import("dart:isolate");
class TestClass{
String strField;
TestClass(this.strField);
}
Future<String> someFunction(msg) {
print('someFunction called with param $msg');
Completer completer = new Completer();
// Next line caused dart vm hangup.
TestClass test = new TestClass('asdfadsf');
completer.complete("some dummy data");
return completer.future;
}
new_isolate() {
port.receive((msg, reply) {
Future f = someFunction(msg);
f.then((r)=>reply.send(r));
});
}
main() {
spawnFunction(new_isolate).call("testMessage").then((s)=>print("result = $s"));
}
- Invoke dart on script test_isolate.dart
What is the expected output?
>> someFunction called with param testMessage
>> result = some dummy data
What do you see instead?
-- Dart process hangs up.
Another twist: Script works successfully with line
-- TestClass test = new TestClass('asdfadsf');
modified to
-- var test = new TestClass('asdfadsf');
What version of the product are you using? On what operating system?
Dart-sdk revision 7552
Windows 7 32bit.