blob: 82f544a0bb5d72ad7add6c9defe4ebc990e45ee7 [file] [log] [blame]
// Copyright (c) 2019, 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.
// @dart = 2.9
/// @assertion Any use of a type [T] which is not well-bounded is a
/// compile-time error.
/// @description Checks that compile error is thrown when call generic
/// function with two dependant type parameters which are not bounded well.
/// @Issue 37061
/// @author iarkh@unipro.ru
class A<X extends A<X>> {}
void testme<X extends Y, Y extends A<X>>() {}
main() {
testme();
//^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
testme<Null, dynamic>();
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
testme<dynamic, Null>();
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
testme<dynamic, dynamic>();
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
testme<Null, Object>();
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
testme<Object, Null>();
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
testme<Object, Object>();
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
testme<Null, void>();
// ^^^^
// [analyzer] unspecified
// [cfe] unspecified
testme<void, Null>();
// ^^^^
// [analyzer] unspecified
// [cfe] unspecified
testme<void, void>();
// ^^^^
// [analyzer] unspecified
// [cfe] unspecified
testme<A<Null>, Null>();
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}