dart-sdk/tests/web/unused_generator_type_parameter_test.dart
Mayank Patke 6005e923d8 [dart2js] Rename issue-specific tests.
The `regress` folder in tests/web and tests/web_2 has been renamed to
`issue`. All issue-numbered tests have been placed there; other tests
have been moved out of that folder.

Change-Id: I4534d34b2ef21f7accc45c3ce097d9be74845e4d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/235984
Reviewed-by: Joshua Litt <joshualitt@google.com>
Commit-Queue: Mayank Patke <fishythefish@google.com>
2022-03-09 22:18:27 +00:00

20 lines
654 B
Dart

// 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.
import "package:expect/expect.dart";
class Foo<X> {
// T is unused, so can be erased, but that should not break anything. The
// generator should still have a header and a body since it needs to compute
// the return type.
Iterable<Set<X>> bar<T>() sync* {}
}
main() {
var f = Foo<String>();
var c = f.bar<int>();
Expect.isFalse(c.iterator is Iterator<Set<int>>);
Expect.isTrue(c.iterator is Iterator<Set<String>>);
}