26e503612a
Fixes https://github.com/dart-lang/sdk/issues/43343. Change-Id: If2a741ba9b13f7817ff765d83f3f5a920860cb9e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163133 Commit-Queue: Alexander Aprelev <aam@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>
37 lines
1.1 KiB
Dart
37 lines
1.1 KiB
Dart
// Copyright (c) 2018, 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.
|
|
|
|
// Verify that partially instantiated generic function remains instantiated
|
|
// after received via ReceivePort.
|
|
|
|
import 'dart:isolate';
|
|
import 'package:expect/expect.dart';
|
|
import 'package:async_helper/async_minitest.dart';
|
|
|
|
// Prevent obfuscation.
|
|
@pragma('vm:entry-point')
|
|
class Dog {}
|
|
|
|
// Prevent obfuscation.
|
|
@pragma('vm:entry-point')
|
|
List<T> decodeFrom<T>(String s) {
|
|
return List();
|
|
}
|
|
|
|
// Prevent obfuscation.
|
|
@pragma('vm:entry-point')
|
|
List<Dog> Function(String s) decodeFromDog = decodeFrom;
|
|
|
|
void main() async {
|
|
final receivePort = ReceivePort();
|
|
receivePort.listen(expectAsync1((data) {
|
|
print("Received $data");
|
|
Expect.equals('$data',
|
|
"[Closure: (String) => List<Dog> from Function 'decodeFrom': static.]");
|
|
receivePort.close();
|
|
}));
|
|
print("Sending $decodeFromDog");
|
|
receivePort.sendPort.send(<dynamic>[decodeFromDog]);
|
|
}
|