Files
sdk/pkg/front_end/testcases/general/issue41210a.dart
T
Johnni Winther 8baa649665 [cfe] Add tests to verify that mixin forwarding stub problems have been fixed
With the new class hierarchy builder and mixin stubs we no longer
insert superfluous forwarding stub nor use mixin declaration/clones
as targets inconsistently.

These test expand upon existing tests to verify that these issue have
been fixed.

Change-Id: I27db6e27e86d8c83692e9a16f7c435f633a599c3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/194787
Reviewed-by: Jens Johansen <jensj@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-04-13 07:55:46 +00:00

36 lines
719 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.
// @dart=2.9
abstract class Interface {
String method(num i);
}
abstract class Interface2 {
String method(covariant int i);
}
mixin A implements Interface {
String method(num i, {String s = "hello"}) => s;
}
abstract class B implements Interface {
String method(num i);
}
class C with A, B {} // error
abstract class D implements Interface, Interface2 {}
class E with A, D {} // ok
abstract class F implements Interface {}
class G with A, F {} // ok
main() {
print(C().method(0));
}