Files
sdk/pkg/front_end/testcases/nnbd/issue40134.dart
T
Johnni Winther 4ad57412bb [cfe] Use legacy erasure and nnbd top merge in computation of supertypes in ClassHierarchyBuilder
Closes #40134

Change-Id: I50e6f4c6fe7b1e0fa7f3e0e609e015f630cff1b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132343
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2020-01-22 08:37:36 +00:00

21 lines
765 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.
// This is a regression test for http://dartbug.com/40134.
class GenericMethodBounds<T> {
Type get t => T;
GenericMethodBounds<E> foo<E extends T>() => new GenericMethodBounds<E>();
GenericMethodBounds<E> bar<E extends void Function(T)>() =>
new GenericMethodBounds<E>();
}
class GenericMethodBoundsDerived extends GenericMethodBounds<num> {
GenericMethodBounds<E> foo<E extends num>() => new GenericMethodBounds<E>();
GenericMethodBounds<E> bar<E extends void Function(num)>() =>
new GenericMethodBounds<E>();
}
main() {}