dart-sdk/tests/language/regress/regress22976_test.dart
Brian Wilkerson 06638483e1 Improve the highlight range for conflicting_generic_interfaces
Change-Id: I4ec19c1ceba747f5f23f7c95462de323fe76ecf6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200240
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
2021-05-18 20:42:33 +00:00

27 lines
819 B
Dart

// Copyright (c) 2015, 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.
// Regression test for issue 22976.
class A<T> {}
class B<T> implements A<T> {}
class C<S, T> implements B<S>, A<T> {}
// [error line 11, column 7, length 1]
// [analyzer] COMPILE_TIME_ERROR.CONFLICTING_GENERIC_INTERFACES
// ^
// [cfe] 'C' can't implement both 'A<S>' and 'A<T>'
main() {
C<int, String> c1 = new C<int, String>();
C<String, int> c2 = new C<String, int>();
A<int> a0 = c1;
A<int> a1 = c2;
// ^^
// [analyzer] COMPILE_TIME_ERROR.INVALID_ASSIGNMENT
// ^
// [cfe] A value of type 'C<String, int>' can't be assigned to a variable of type 'A<int>'.
}