dart-sdk/tests/language/regress/regress45763_test.dart
Lasse R.H. Nielsen a5e18113f3 Remove references to triple-shift and generic-metadata experiments.
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>
2021-05-12 13:35:00 +00:00

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);
}