mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 04:37:12 +00:00
a5e18113f3
TEST= removed flags from test. No behavior should change. Change-Id: I401bfb68c082d1bd405a118d5eca6a47a807945f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/199241 Commit-Queue: Lasse R.H. Nielsen <lrn@google.com> Reviewed-by: Alexander Thomas <athom@google.com>
25 lines
606 B
Dart
25 lines
606 B
Dart
// Copyright (c) 2021, 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.
|
|
|
|
|
|
import "package:expect/expect.dart";
|
|
|
|
Type? capturedTypeArgument;
|
|
Type typeOf<X>() => X;
|
|
|
|
X captureTypeArgument<X>() {
|
|
capturedTypeArgument = X;
|
|
throw "";
|
|
}
|
|
|
|
typedef check = void Function<T>();
|
|
|
|
void main() {
|
|
void f(check Function<T>() g) => g();
|
|
try {
|
|
f(<T>() => captureTypeArgument());
|
|
} catch (e) {}
|
|
Expect.equals(typeOf<void Function<T>()>(), capturedTypeArgument);
|
|
}
|