<commit_before>/*
 * Copyright (c) 2020, 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.
 */
/**
 * @assertion The definitions of least and greatest closure are changed in null
 * safe libraries to substitute [Never] in positions where previously [Null
 * would have been substituted, and [Object?] in positions where previously
 * [Object] or [dynamic] would have been substituted.
 * @description Check that correct type is substituted for [typedef check<X> =
 * void Function<X1 extends X>()].
 * @note Read more about the least and greatest closure test template:
 * https://github.com/dart-lang/co19/issues/575#issuecomment-613542349
 *
 * @author i<EMAIL>
 */
// SharedOptions=--enable-experiment=non-nullable
// Requirements=nnbd-strong

import "../../../../Utils/expect.dart";

typedef check<X> = void Function<X1 extends X>() Function();
typedef expected = void Function<X1 extends Object?>() Function();

void main() {
  void f(check Function() g) => g();
  Expect.throws(() { f(() => captureTypeArgument()..call()); });
  Expect.equals(expected, capturedTypeArgument);
}<commit_msg>Fixes #602: Missing Issue tag added.<commit_after>/*
 * Copyright (c) 2020, 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.
 */
/**
 * @assertion The definitions of least and greatest closure are changed in null
 * safe libraries to substitute [Never] in positions where previously [Null
 * would have been substituted, and [Object?] in positions where previously
 * [Object] or [dynamic] would have been substituted.
 * @description Check that correct type is substituted for [typedef check<X> =
 * void Function<X1 extends X>()].
 * @note Read more about the least and greatest closure test template:
 * https://github.com/dart-lang/co19/issues/575#issuecomment-613542349
 *
 * @Issue 44125
 * @author <EMAIL>
 */
// SharedOptions=--enable-experiment=non-nullable
// Requirements=nnbd-strong

import "../../../../Utils/expect.dart";

typedef check<X> = void Function<X1 extends X>() Function();
typedef expected = void Function<X1 extends Object?>() Function();

void main() {
  void f(check Function() g) => g();
  Expect.throws(() { f(() => captureTypeArgument()..call()); });
  Expect.equals(expected, capturedTypeArgument);
}
{'fraction_non_alphanumeric': 0.12927605409705648, 'fraction_numerical': 0.01988862370723946, 'mean_word_length': 4.294736842105263, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6037601', 'n_tokens_mistral': 730, 'n_tokens_neox': 678, 'n_words': 275}