mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:09:49 +00:00
924b9f55ba
The "@compile-error" comment is an old not-great way of defining static error tests. Also fix a test to use a mixin declaration instead of a class for declaring a mixin. This was broken by class modifiers but the breakage was masked by @compile-error treating a test as passing if any compile error, even an unrelated one, is reported. See: https://github.com/dart-lang/sdk/issues/45634 Change-Id: I5d1d387002d886cb87340e2559bf8ed01c3f2d6a Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/296409 Commit-Queue: Bob Nystrom <rnystrom@google.com> Auto-Submit: Bob Nystrom <rnystrom@google.com> Reviewed-by: Nate Bosch <nbosch@google.com>
27 lines
904 B
Dart
27 lines
904 B
Dart
// Copyright (c) 2018, 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.
|
|
|
|
class I<X, Y> {}
|
|
|
|
mixin M0<T> implements I<T, List<T>> {}
|
|
|
|
mixin M1<T> implements I<List<T>, T> {}
|
|
|
|
//////////////////////////////////////////////////////
|
|
// Inference does not produce infinite types
|
|
///////////////////////////////////////////////////////
|
|
|
|
// No solution, even with unification, since solution
|
|
// requires that I<List<U0>, U0> == I<U1, List<U1>>
|
|
// for some U0, U1, and hence that:
|
|
// U0 = List<U1>
|
|
// U1 = List<U0>
|
|
// which has no finite solution
|
|
class A with M0, M1 {}
|
|
// ^
|
|
// [analyzer] COMPILE_TIME_ERROR.CONFLICTING_GENERIC_INTERFACES
|
|
// [cfe] 'Object with M0, M1' can't implement both 'I<dynamic, List<dynamic>>' and 'I<List<dynamic>, dynamic>'
|
|
|
|
void main() {}
|