[VM/tests] Use appropriate type when invoking Isolate.spawn

Fixes https://github.com/dart-lang/sdk/issues/36917

Change-Id: I83ae6ad6afefb62da4228d168bbec805aa74cf92
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/102101
Commit-Queue: Siva Annamalai <asiva@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Zach Anderson <zra@google.com>
diff --git a/runtime/tests/vm/dart/spawn_shutdown_test.dart b/runtime/tests/vm/dart/spawn_shutdown_test.dart
index 235a0d8..6e42f3e 100644
--- a/runtime/tests/vm/dart/spawn_shutdown_test.dart
+++ b/runtime/tests/vm/dart/spawn_shutdown_test.dart
@@ -1,6 +1,7 @@
 // Copyright (c) 2015, the Dart project authors.  Please see the AUTHORS file
 // for details. All rights reserved. Use of this source code is governed by a
 // BSD-style license that can be found in the LICENSE file.
+// VMOptions=--enable-asserts
 
 import 'dart:async';
 import 'dart:io';
@@ -16,7 +17,7 @@
 
 trySpawn(Function f, Object o) async {
   try {
-    await Isolate.spawn(f, o);
+    await Isolate.spawn<SendPort>(f, o);
   } catch (e) {
     // Isolate spawning may fail if the program is ending.
     assert(e is IsolateSpawnException);