[cfe] Handle member signatures from dill in class hierarchy builder
Closes #41210
Change-Id: I1e38e014c04f140dd37821375a6efbfe73f37562
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141545
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
diff --git a/pkg/front_end/lib/src/fasta/dill/dill_member_builder.dart b/pkg/front_end/lib/src/fasta/dill/dill_member_builder.dart
index 8afca33..5e8589c 100644
--- a/pkg/front_end/lib/src/fasta/dill/dill_member_builder.dart
+++ b/pkg/front_end/lib/src/fasta/dill/dill_member_builder.dart
@@ -162,6 +162,14 @@
memberBuilder.kind == ProcedureKind.Setter;
@override
+ bool get isSynthesized {
+ Member member = memberBuilder.member;
+ return member is Procedure &&
+ (member.isMemberSignature ||
+ (member.isForwardingStub && !member.isForwardingSemiStub));
+ }
+
+ @override
bool get isFunction => !isProperty;
@override
diff --git a/pkg/front_end/lib/src/fasta/kernel/class_hierarchy_builder.dart b/pkg/front_end/lib/src/fasta/kernel/class_hierarchy_builder.dart
index 206665b..c080b03 100644
--- a/pkg/front_end/lib/src/fasta/kernel/class_hierarchy_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/class_hierarchy_builder.dart
@@ -1773,8 +1773,11 @@
// [declaredMember] is a method declared in [cls]. This means it
// defines the interface of this class regardless if its abstract.
- registerOverrideDependency(declaredMember, extendedMember.abstract);
- registerOverrideCheck(declaredMember, extendedMember.abstract);
+ if (!declaredMember.isSynthesized) {
+ registerOverrideDependency(
+ declaredMember, extendedMember.abstract);
+ registerOverrideCheck(declaredMember, extendedMember.abstract);
+ }
if (declaredMember.isAbstract) {
if (extendedMember.isAbstract) {
diff --git a/pkg/front_end/lib/src/fasta/kernel/forwarding_node.dart b/pkg/front_end/lib/src/fasta/kernel/forwarding_node.dart
index 8e68472..66897dc 100644
--- a/pkg/front_end/lib/src/fasta/kernel/forwarding_node.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/forwarding_node.dart
@@ -412,7 +412,8 @@
superclass, procedure.name, kind == ProcedureKind.Setter);
if (superTarget == null) return;
if (superTarget is Procedure && superTarget.isForwardingStub) {
- superTarget = _getForwardingStubSuperTarget(superTarget);
+ Procedure superProcedure = superTarget;
+ superTarget = superProcedure.forwardingStubSuperTarget;
}
procedure.isAbstract = false;
if (!procedure.isForwardingStub) {
@@ -533,21 +534,6 @@
return candidate.getMember(hierarchy);
}
- static Member _getForwardingStubSuperTarget(Procedure forwardingStub) {
- // TODO(paulberry): when dartbug.com/31562 is fixed, this should become
- // easier.
- ReturnStatement body = forwardingStub.function.body;
- Expression expression = body.expression;
- if (expression is SuperMethodInvocation) {
- return expression.interfaceTarget;
- } else if (expression is SuperPropertySet) {
- return expression.interfaceTarget;
- } else {
- return unhandled('${expression.runtimeType}',
- '_getForwardingStubSuperTarget', -1, null);
- }
- }
-
Substitution _substitutionFor(
List<TypeParameter> stubTypeParameters, Member candidate, Class class_) {
Substitution substitution = Substitution.fromInterfaceType(
diff --git a/pkg/front_end/test/spell_checking_list_tests.txt b/pkg/front_end/test/spell_checking_list_tests.txt
index a4a287b..46fad1f 100644
--- a/pkg/front_end/test/spell_checking_list_tests.txt
+++ b/pkg/front_end/test/spell_checking_list_tests.txt
@@ -271,6 +271,7 @@
ioo
isolate
isolates
+issue41210b
iter
joo
jumped
diff --git a/pkg/front_end/testcases/general/issue41210a.dart b/pkg/front_end/testcases/general/issue41210a.dart
new file mode 100644
index 0000000..7f16a06
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue41210a.dart
@@ -0,0 +1,29 @@
+// 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.
+
+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
+
+main() {
+ print(C().method(0));
+}
diff --git a/pkg/front_end/testcases/general/issue41210a.dart.outline.expect b/pkg/front_end/testcases/general/issue41210a.dart.outline.expect
new file mode 100644
index 0000000..aee4934
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue41210a.dart.outline.expect
@@ -0,0 +1,77 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/general/issue41210a.dart:21:7: Error: Applying the mixin 'B' to 'Object with A' introduces an erroneous override of 'method'.
+// class C with A, B {} // error
+// ^
+// pkg/front_end/testcases/general/issue41210a.dart:18:10: Context: The method 'B.method' has fewer named arguments than those of overridden method 'A.method'.
+// String method(num i);
+// ^
+// pkg/front_end/testcases/general/issue41210a.dart:14:10: Context: This is the overridden method ('method').
+// String method(num i, {String s = "hello"}) => s;
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+abstract class Interface extends core::Object {
+ synthetic constructor •() → self::Interface*
+ ;
+ abstract method method(core::num* i) → core::String*;
+}
+abstract class Interface2 extends core::Object {
+ synthetic constructor •() → self::Interface2*
+ ;
+ abstract method method(covariant core::int* i) → core::String*;
+}
+abstract class A extends core::Object implements self::Interface /*isMixinDeclaration*/ {
+ method method(core::num* i, {core::String* s = "hello"}) → core::String*
+ ;
+}
+abstract class B extends core::Object implements self::Interface {
+ synthetic constructor •() → self::B*
+ ;
+ abstract method method(core::num* i) → core::String*;
+}
+abstract class _C&Object&A = core::Object with self::A /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_C&Object&A*
+ : super core::Object::•()
+ ;
+}
+abstract class _C&Object&A&B = self::_C&Object&A with self::B /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_C&Object&A&B*
+ : super self::_C&Object&A::•()
+ ;
+ abstract forwarding-stub method method(core::num* i, {core::String* s}) → core::String*;
+}
+class C extends self::_C&Object&A&B {
+ synthetic constructor •() → self::C*
+ ;
+ abstract forwarding-stub method method(core::num* i, {core::String* s}) → core::String*;
+}
+abstract class D extends core::Object implements self::Interface, self::Interface2 {
+ synthetic constructor •() → self::D*
+ ;
+ abstract forwarding-stub method method(covariant core::num* i) → core::String*;
+}
+abstract class _E&Object&A = core::Object with self::A /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_E&Object&A*
+ : super core::Object::•()
+ ;
+}
+abstract class _E&Object&A&D = self::_E&Object&A with self::D /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_E&Object&A&D*
+ : super self::_E&Object&A::•()
+ ;
+ forwarding-stub method method(covariant core::num* i, {core::String* s}) → core::String*
+ return super.{self::A::method}(i, s: s);
+}
+class E extends self::_E&Object&A&D {
+ synthetic constructor •() → self::E*
+ ;
+ forwarding-stub method method(covariant core::num* i, {core::String* s}) → core::String*
+ return super.{self::A::method}(i, s: s);
+}
+static method main() → dynamic
+ ;
diff --git a/pkg/front_end/testcases/general/issue41210a.dart.strong.expect b/pkg/front_end/testcases/general/issue41210a.dart.strong.expect
new file mode 100644
index 0000000..c8758f4
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue41210a.dart.strong.expect
@@ -0,0 +1,88 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/general/issue41210a.dart:21:7: Error: Applying the mixin 'B' to 'Object with A' introduces an erroneous override of 'method'.
+// class C with A, B {} // error
+// ^
+// pkg/front_end/testcases/general/issue41210a.dart:18:10: Context: The method 'B.method' has fewer named arguments than those of overridden method 'A.method'.
+// String method(num i);
+// ^
+// pkg/front_end/testcases/general/issue41210a.dart:14:10: Context: This is the overridden method ('method').
+// String method(num i, {String s = "hello"}) => s;
+// ^
+//
+import self as self;
+import "dart:core" as core;
+
+abstract class Interface extends core::Object {
+ synthetic constructor •() → self::Interface*
+ : super core::Object::•()
+ ;
+ abstract method method(core::num* i) → core::String*;
+}
+abstract class Interface2 extends core::Object {
+ synthetic constructor •() → self::Interface2*
+ : super core::Object::•()
+ ;
+ abstract method method(covariant core::int* i) → core::String*;
+}
+abstract class A extends core::Object implements self::Interface /*isMixinDeclaration*/ {
+ method method(core::num* i, {core::String* s = #C1}) → core::String*
+ return s;
+}
+abstract class B extends core::Object implements self::Interface {
+ synthetic constructor •() → self::B*
+ : super core::Object::•()
+ ;
+ abstract method method(core::num* i) → core::String*;
+}
+abstract class _C&Object&A = core::Object with self::A /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_C&Object&A*
+ : super core::Object::•()
+ ;
+}
+abstract class _C&Object&A&B = self::_C&Object&A with self::B /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_C&Object&A&B*
+ : super self::_C&Object&A::•()
+ ;
+ abstract forwarding-stub method method(core::num* i, {core::String* s = #C1}) → core::String*;
+}
+class C extends self::_C&Object&A&B {
+ synthetic constructor •() → self::C*
+ : super self::_C&Object&A&B::•()
+ ;
+ abstract forwarding-stub method method(core::num* i, {core::String* s = #C1}) → core::String*;
+}
+abstract class D extends core::Object implements self::Interface, self::Interface2 {
+ synthetic constructor •() → self::D*
+ : super core::Object::•()
+ ;
+ abstract forwarding-stub method method(covariant core::num* i) → core::String*;
+}
+abstract class _E&Object&A = core::Object with self::A /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_E&Object&A*
+ : super core::Object::•()
+ ;
+}
+abstract class _E&Object&A&D = self::_E&Object&A with self::D /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_E&Object&A&D*
+ : super self::_E&Object&A::•()
+ ;
+ forwarding-stub method method(covariant core::num* i, {core::String* s = #C1}) → core::String*
+ return super.{self::A::method}(i, s: s);
+}
+class E extends self::_E&Object&A&D {
+ synthetic constructor •() → self::E*
+ : super self::_E&Object&A&D::•()
+ ;
+ forwarding-stub method method(covariant core::num* i, {core::String* s = #C1}) → core::String*
+ return super.{self::A::method}(i, s: s);
+}
+static method main() → dynamic {
+ core::print(new self::C::•().{self::C::method}(0));
+}
+
+constants {
+ #C1 = "hello"
+}
diff --git a/pkg/front_end/testcases/general/issue41210b/issue41210.dart b/pkg/front_end/testcases/general/issue41210b/issue41210.dart
new file mode 100644
index 0000000..01f7b3b
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue41210b/issue41210.dart
@@ -0,0 +1,13 @@
+// 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.
+
+import 'issue41210_lib.dart';
+
+class C with A, B {} // error
+
+class E with A, D {} // ok
+
+main() {
+ print(C().method(0));
+}
diff --git a/pkg/front_end/testcases/general/issue41210b/issue41210_lib.dart b/pkg/front_end/testcases/general/issue41210b/issue41210_lib.dart
new file mode 100644
index 0000000..61a4823
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue41210b/issue41210_lib.dart
@@ -0,0 +1,21 @@
+// 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.
+
+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);
+}
+
+abstract class D implements Interface, Interface2 {}
diff --git a/pkg/front_end/testcases/general/issue41210b/issue41210_lib.dart.outline.expect b/pkg/front_end/testcases/general/issue41210b/issue41210_lib.dart.outline.expect
new file mode 100644
index 0000000..c7a2391
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue41210b/issue41210_lib.dart.outline.expect
@@ -0,0 +1,83 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/general/issue41210b/issue41210.dart:7:7: Error: Applying the mixin 'B' to 'Object with A' introduces an erroneous override of 'method'.
+// class C with A, B {} // error
+// ^
+// pkg/front_end/testcases/general/issue41210b/issue41210_lib.dart:18:10: Context: The method 'B.method' has fewer named arguments than those of overridden method 'A.method'.
+// String method(num i);
+// ^
+// pkg/front_end/testcases/general/issue41210b/issue41210_lib.dart:14:10: Context: This is the overridden method ('method').
+// String method(num i, {String s = "hello"}) => s;
+// ^
+//
+import self as self;
+import "dart:core" as core;
+import "issue41210_lib.dart" as iss;
+
+import "org-dartlang-testcase:///issue41210_lib.dart";
+
+abstract class _C&Object&A = core::Object with iss::A /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_C&Object&A*
+ : super core::Object::•()
+ ;
+}
+abstract class _C&Object&A&B = self::_C&Object&A with iss::B /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_C&Object&A&B*
+ : super self::_C&Object&A::•()
+ ;
+ abstract forwarding-stub method method(core::num* i, {core::String* s}) → core::String*;
+}
+class C extends self::_C&Object&A&B {
+ synthetic constructor •() → self::C*
+ ;
+ abstract forwarding-stub method method(core::num* i, {core::String* s}) → core::String*;
+}
+abstract class _E&Object&A = core::Object with iss::A /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_E&Object&A*
+ : super core::Object::•()
+ ;
+}
+abstract class _E&Object&A&D = self::_E&Object&A with iss::D /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_E&Object&A&D*
+ : super self::_E&Object&A::•()
+ ;
+ abstract forwarding-stub method method(covariant core::num* i, {core::String* s}) → core::String*;
+}
+class E extends self::_E&Object&A&D {
+ synthetic constructor •() → self::E*
+ ;
+ abstract forwarding-stub method method(covariant core::num* i, {core::String* s}) → core::String*;
+}
+static method main() → dynamic
+ ;
+
+library;
+import self as iss;
+import "dart:core" as core;
+
+abstract class Interface extends core::Object {
+ synthetic constructor •() → iss::Interface*
+ ;
+ abstract method method(core::num* i) → core::String*;
+}
+abstract class Interface2 extends core::Object {
+ synthetic constructor •() → iss::Interface2*
+ ;
+ abstract method method(covariant core::int* i) → core::String*;
+}
+abstract class A extends core::Object implements iss::Interface /*isMixinDeclaration*/ {
+ method method(core::num* i, {core::String* s = "hello"}) → core::String*
+ ;
+}
+abstract class B extends core::Object implements iss::Interface {
+ synthetic constructor •() → iss::B*
+ ;
+ abstract method method(core::num* i) → core::String*;
+}
+abstract class D extends core::Object implements iss::Interface, iss::Interface2 {
+ synthetic constructor •() → iss::D*
+ ;
+ abstract forwarding-stub method method(covariant core::num* i) → core::String*;
+}
diff --git a/pkg/front_end/testcases/general/issue41210b/issue41210_lib.dart.strong.expect b/pkg/front_end/testcases/general/issue41210b/issue41210_lib.dart.strong.expect
new file mode 100644
index 0000000..2bd5392
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue41210b/issue41210_lib.dart.strong.expect
@@ -0,0 +1,94 @@
+library;
+//
+// Problems in library:
+//
+// pkg/front_end/testcases/general/issue41210b/issue41210.dart:7:7: Error: Applying the mixin 'B' to 'Object with A' introduces an erroneous override of 'method'.
+// class C with A, B {} // error
+// ^
+// pkg/front_end/testcases/general/issue41210b/issue41210_lib.dart:18:10: Context: The method 'B.method' has fewer named arguments than those of overridden method 'A.method'.
+// String method(num i);
+// ^
+// pkg/front_end/testcases/general/issue41210b/issue41210_lib.dart:14:10: Context: This is the overridden method ('method').
+// String method(num i, {String s = "hello"}) => s;
+// ^
+//
+import self as self;
+import "dart:core" as core;
+import "issue41210_lib.dart" as iss;
+
+import "org-dartlang-testcase:///issue41210_lib.dart";
+
+abstract class _C&Object&A = core::Object with iss::A /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_C&Object&A*
+ : super core::Object::•()
+ ;
+}
+abstract class _C&Object&A&B = self::_C&Object&A with iss::B /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_C&Object&A&B*
+ : super self::_C&Object&A::•()
+ ;
+ abstract forwarding-stub method method(core::num* i, {core::String* s = #C1}) → core::String*;
+}
+class C extends self::_C&Object&A&B {
+ synthetic constructor •() → self::C*
+ : super self::_C&Object&A&B::•()
+ ;
+ abstract forwarding-stub method method(core::num* i, {core::String* s = #C1}) → core::String*;
+}
+abstract class _E&Object&A = core::Object with iss::A /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_E&Object&A*
+ : super core::Object::•()
+ ;
+}
+abstract class _E&Object&A&D = self::_E&Object&A with iss::D /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_E&Object&A&D*
+ : super self::_E&Object&A::•()
+ ;
+ abstract forwarding-stub method method(covariant core::num* i, {core::String* s = #C1}) → core::String*;
+}
+class E extends self::_E&Object&A&D {
+ synthetic constructor •() → self::E*
+ : super self::_E&Object&A&D::•()
+ ;
+ abstract forwarding-stub method method(covariant core::num* i, {core::String* s = #C1}) → core::String*;
+}
+static method main() → dynamic {
+ core::print(new self::C::•().{self::C::method}(0));
+}
+
+library;
+import self as iss;
+import "dart:core" as core;
+
+abstract class Interface extends core::Object {
+ synthetic constructor •() → iss::Interface*
+ : super core::Object::•()
+ ;
+ abstract method method(core::num* i) → core::String*;
+}
+abstract class Interface2 extends core::Object {
+ synthetic constructor •() → iss::Interface2*
+ : super core::Object::•()
+ ;
+ abstract method method(covariant core::int* i) → core::String*;
+}
+abstract class A extends core::Object implements iss::Interface /*isMixinDeclaration*/ {
+ method method(core::num* i, {core::String* s = #C1}) → core::String*
+ return s;
+}
+abstract class B extends core::Object implements iss::Interface {
+ synthetic constructor •() → iss::B*
+ : super core::Object::•()
+ ;
+ abstract method method(core::num* i) → core::String*;
+}
+abstract class D extends core::Object implements iss::Interface, iss::Interface2 {
+ synthetic constructor •() → iss::D*
+ : super core::Object::•()
+ ;
+ abstract forwarding-stub method method(covariant core::num* i) → core::String*;
+}
+
+constants {
+ #C1 = "hello"
+}
diff --git a/pkg/front_end/testcases/general/issue41210b/link.options b/pkg/front_end/testcases/general/issue41210b/link.options
new file mode 100644
index 0000000..09aef2a
--- /dev/null
+++ b/pkg/front_end/testcases/general/issue41210b/link.options
@@ -0,0 +1 @@
+issue41210_lib.dart
\ No newline at end of file
diff --git a/pkg/front_end/testcases/nnbd/issue41210a/issue41210.dart b/pkg/front_end/testcases/nnbd/issue41210a/issue41210.dart
new file mode 100644
index 0000000..384a53c
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41210a/issue41210.dart
@@ -0,0 +1,13 @@
+// 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.6
+
+import 'issue41210_lib1.dart';
+
+class C with A, B {} // ok
+
+main() {
+ print(C().method());
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41210a/issue41210_lib1.dart b/pkg/front_end/testcases/nnbd/issue41210a/issue41210_lib1.dart
new file mode 100644
index 0000000..d9553df
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41210a/issue41210_lib1.dart
@@ -0,0 +1,15 @@
+// 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.6
+
+import 'issue41210_lib2.dart';
+
+mixin A implements Interface {
+ String method({String s = "hello"}) => s;
+}
+
+abstract class B implements Interface {}
+
+void main() {}
diff --git a/pkg/front_end/testcases/nnbd/issue41210a/issue41210_lib1.dart.outline.expect b/pkg/front_end/testcases/nnbd/issue41210a/issue41210_lib1.dart.outline.expect
new file mode 100644
index 0000000..2640497
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41210a/issue41210_lib1.dart.outline.expect
@@ -0,0 +1,54 @@
+library;
+import self as self;
+import "dart:core" as core;
+import "issue41210_lib1.dart" as iss;
+
+import "org-dartlang-testcase:///issue41210_lib1.dart";
+
+abstract class _C&Object&A = core::Object with iss::A /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_C&Object&A*
+ : super core::Object::•()
+ ;
+}
+abstract class _C&Object&A&B = self::_C&Object&A with iss::B /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_C&Object&A&B*
+ : super self::_C&Object&A::•()
+ ;
+ abstract forwarding-stub method method({core::String* s}) → core::String*;
+}
+class C extends self::_C&Object&A&B {
+ synthetic constructor •() → self::C*
+ ;
+ abstract forwarding-stub method method({core::String* s}) → core::String*;
+}
+static method main() → dynamic
+ ;
+
+library;
+import self as iss;
+import "dart:core" as core;
+import "issue41210_lib2.dart" as iss2;
+
+import "org-dartlang-testcase:///issue41210_lib2.dart";
+
+abstract class A extends core::Object implements iss2::Interface /*isMixinDeclaration*/ {
+ method method({core::String* s = "hello"}) → core::String*
+ ;
+}
+abstract class B extends core::Object implements iss2::Interface {
+ synthetic constructor •() → iss::B*
+ ;
+ abstract member-signature method method() → core::String*;
+}
+static method main() → void
+ ;
+
+library /*isNonNullableByDefault*/;
+import self as iss2;
+import "dart:core" as core;
+
+abstract class Interface extends core::Object {
+ synthetic constructor •() → iss2::Interface
+ ;
+ abstract method method() → core::String;
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41210a/issue41210_lib1.dart.strong.expect b/pkg/front_end/testcases/nnbd/issue41210a/issue41210_lib1.dart.strong.expect
new file mode 100644
index 0000000..a447e57
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41210a/issue41210_lib1.dart.strong.expect
@@ -0,0 +1,61 @@
+library;
+import self as self;
+import "dart:core" as core;
+import "issue41210_lib1.dart" as iss;
+
+import "org-dartlang-testcase:///issue41210_lib1.dart";
+
+abstract class _C&Object&A = core::Object with iss::A /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_C&Object&A*
+ : super core::Object::•()
+ ;
+}
+abstract class _C&Object&A&B = self::_C&Object&A with iss::B /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_C&Object&A&B*
+ : super self::_C&Object&A::•()
+ ;
+ abstract forwarding-stub method method({core::String* s = #C1}) → core::String*;
+}
+class C extends self::_C&Object&A&B {
+ synthetic constructor •() → self::C*
+ : super self::_C&Object&A&B::•()
+ ;
+ abstract forwarding-stub method method({core::String* s = #C1}) → core::String*;
+}
+static method main() → dynamic {
+ core::print(new self::C::•().{self::C::method}());
+}
+
+library;
+import self as iss;
+import "dart:core" as core;
+import "issue41210_lib2.dart" as iss2;
+
+import "org-dartlang-testcase:///issue41210_lib2.dart";
+
+abstract class A extends core::Object implements iss2::Interface /*isMixinDeclaration*/ {
+ method method({core::String* s = #C1}) → core::String*
+ return s;
+}
+abstract class B extends core::Object implements iss2::Interface {
+ synthetic constructor •() → iss::B*
+ : super core::Object::•()
+ ;
+ abstract member-signature method method() → core::String*;
+}
+static method main() → void {}
+
+library /*isNonNullableByDefault*/;
+import self as iss2;
+import "dart:core" as core;
+
+abstract class Interface extends core::Object {
+ synthetic constructor •() → iss2::Interface
+ : super core::Object::•()
+ ;
+ abstract method method() → core::String;
+}
+
+constants {
+ #C1 = "hello"
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41210a/issue41210_lib1.dart.weak.expect b/pkg/front_end/testcases/nnbd/issue41210a/issue41210_lib1.dart.weak.expect
new file mode 100644
index 0000000..a447e57
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41210a/issue41210_lib1.dart.weak.expect
@@ -0,0 +1,61 @@
+library;
+import self as self;
+import "dart:core" as core;
+import "issue41210_lib1.dart" as iss;
+
+import "org-dartlang-testcase:///issue41210_lib1.dart";
+
+abstract class _C&Object&A = core::Object with iss::A /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_C&Object&A*
+ : super core::Object::•()
+ ;
+}
+abstract class _C&Object&A&B = self::_C&Object&A with iss::B /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_C&Object&A&B*
+ : super self::_C&Object&A::•()
+ ;
+ abstract forwarding-stub method method({core::String* s = #C1}) → core::String*;
+}
+class C extends self::_C&Object&A&B {
+ synthetic constructor •() → self::C*
+ : super self::_C&Object&A&B::•()
+ ;
+ abstract forwarding-stub method method({core::String* s = #C1}) → core::String*;
+}
+static method main() → dynamic {
+ core::print(new self::C::•().{self::C::method}());
+}
+
+library;
+import self as iss;
+import "dart:core" as core;
+import "issue41210_lib2.dart" as iss2;
+
+import "org-dartlang-testcase:///issue41210_lib2.dart";
+
+abstract class A extends core::Object implements iss2::Interface /*isMixinDeclaration*/ {
+ method method({core::String* s = #C1}) → core::String*
+ return s;
+}
+abstract class B extends core::Object implements iss2::Interface {
+ synthetic constructor •() → iss::B*
+ : super core::Object::•()
+ ;
+ abstract member-signature method method() → core::String*;
+}
+static method main() → void {}
+
+library /*isNonNullableByDefault*/;
+import self as iss2;
+import "dart:core" as core;
+
+abstract class Interface extends core::Object {
+ synthetic constructor •() → iss2::Interface
+ : super core::Object::•()
+ ;
+ abstract method method() → core::String;
+}
+
+constants {
+ #C1 = "hello"
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41210a/issue41210_lib2.dart b/pkg/front_end/testcases/nnbd/issue41210a/issue41210_lib2.dart
new file mode 100644
index 0000000..3f2afd0
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41210a/issue41210_lib2.dart
@@ -0,0 +1,7 @@
+// 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.
+
+abstract class Interface {
+ String method();
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41210a/link.options b/pkg/front_end/testcases/nnbd/issue41210a/link.options
new file mode 100644
index 0000000..184abb1
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41210a/link.options
@@ -0,0 +1,2 @@
+issue41210_lib1.dart
+issue41210_lib2.dart
diff --git a/pkg/front_end/testcases/nnbd/issue41210b.dart b/pkg/front_end/testcases/nnbd/issue41210b.dart
new file mode 100644
index 0000000..29a66fc
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41210b.dart
@@ -0,0 +1,13 @@
+// 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.6
+
+import 'issue41210b_lib1.dart';
+
+class C with A, B {} // ok
+
+main() {
+ print(C().method());
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41210b.dart.outline.expect b/pkg/front_end/testcases/nnbd/issue41210b.dart.outline.expect
new file mode 100644
index 0000000..b3bea87
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41210b.dart.outline.expect
@@ -0,0 +1,52 @@
+library;
+import self as self;
+import "dart:core" as core;
+import "issue41210b_lib1.dart" as iss;
+
+import "org-dartlang-testcase:///issue41210b_lib1.dart";
+
+abstract class _C&Object&A = core::Object with iss::A /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_C&Object&A*
+ : super core::Object::•()
+ ;
+}
+abstract class _C&Object&A&B = self::_C&Object&A with iss::B /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_C&Object&A&B*
+ : super self::_C&Object&A::•()
+ ;
+}
+class C extends self::_C&Object&A&B {
+ synthetic constructor •() → self::C*
+ ;
+}
+static method main() → dynamic
+ ;
+
+library;
+import self as iss;
+import "dart:core" as core;
+import "issue41210b_lib2.dart" as iss2;
+
+import "org-dartlang-testcase:///issue41210b_lib2.dart";
+
+abstract class A extends core::Object implements iss2::Interface /*isMixinDeclaration*/ {
+ method method({core::String* s = "hello"}) → core::String*
+ ;
+}
+abstract class B extends core::Object implements iss2::Interface {
+ synthetic constructor •() → iss::B*
+ ;
+ abstract member-signature method method() → core::String*;
+}
+static method main() → void
+ ;
+
+library /*isNonNullableByDefault*/;
+import self as iss2;
+import "dart:core" as core;
+
+abstract class Interface extends core::Object {
+ synthetic constructor •() → iss2::Interface
+ ;
+ abstract method method() → core::String;
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41210b.dart.strong.expect b/pkg/front_end/testcases/nnbd/issue41210b.dart.strong.expect
new file mode 100644
index 0000000..3679eca
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41210b.dart.strong.expect
@@ -0,0 +1,59 @@
+library;
+import self as self;
+import "dart:core" as core;
+import "issue41210b_lib1.dart" as iss;
+
+import "org-dartlang-testcase:///issue41210b_lib1.dart";
+
+abstract class _C&Object&A = core::Object with iss::A /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_C&Object&A*
+ : super core::Object::•()
+ ;
+}
+abstract class _C&Object&A&B = self::_C&Object&A with iss::B /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_C&Object&A&B*
+ : super self::_C&Object&A::•()
+ ;
+}
+class C extends self::_C&Object&A&B {
+ synthetic constructor •() → self::C*
+ : super self::_C&Object&A&B::•()
+ ;
+}
+static method main() → dynamic {
+ core::print(new self::C::•().{iss::A::method}());
+}
+
+library;
+import self as iss;
+import "dart:core" as core;
+import "issue41210b_lib2.dart" as iss2;
+
+import "org-dartlang-testcase:///issue41210b_lib2.dart";
+
+abstract class A extends core::Object implements iss2::Interface /*isMixinDeclaration*/ {
+ method method({core::String* s = #C1}) → core::String*
+ return s;
+}
+abstract class B extends core::Object implements iss2::Interface {
+ synthetic constructor •() → iss::B*
+ : super core::Object::•()
+ ;
+ abstract member-signature method method() → core::String*;
+}
+static method main() → void {}
+
+library /*isNonNullableByDefault*/;
+import self as iss2;
+import "dart:core" as core;
+
+abstract class Interface extends core::Object {
+ synthetic constructor •() → iss2::Interface
+ : super core::Object::•()
+ ;
+ abstract method method() → core::String;
+}
+
+constants {
+ #C1 = "hello"
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41210b.dart.weak.expect b/pkg/front_end/testcases/nnbd/issue41210b.dart.weak.expect
new file mode 100644
index 0000000..3679eca
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41210b.dart.weak.expect
@@ -0,0 +1,59 @@
+library;
+import self as self;
+import "dart:core" as core;
+import "issue41210b_lib1.dart" as iss;
+
+import "org-dartlang-testcase:///issue41210b_lib1.dart";
+
+abstract class _C&Object&A = core::Object with iss::A /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_C&Object&A*
+ : super core::Object::•()
+ ;
+}
+abstract class _C&Object&A&B = self::_C&Object&A with iss::B /*isAnonymousMixin,hasConstConstructor*/ {
+ const synthetic constructor •() → self::_C&Object&A&B*
+ : super self::_C&Object&A::•()
+ ;
+}
+class C extends self::_C&Object&A&B {
+ synthetic constructor •() → self::C*
+ : super self::_C&Object&A&B::•()
+ ;
+}
+static method main() → dynamic {
+ core::print(new self::C::•().{iss::A::method}());
+}
+
+library;
+import self as iss;
+import "dart:core" as core;
+import "issue41210b_lib2.dart" as iss2;
+
+import "org-dartlang-testcase:///issue41210b_lib2.dart";
+
+abstract class A extends core::Object implements iss2::Interface /*isMixinDeclaration*/ {
+ method method({core::String* s = #C1}) → core::String*
+ return s;
+}
+abstract class B extends core::Object implements iss2::Interface {
+ synthetic constructor •() → iss::B*
+ : super core::Object::•()
+ ;
+ abstract member-signature method method() → core::String*;
+}
+static method main() → void {}
+
+library /*isNonNullableByDefault*/;
+import self as iss2;
+import "dart:core" as core;
+
+abstract class Interface extends core::Object {
+ synthetic constructor •() → iss2::Interface
+ : super core::Object::•()
+ ;
+ abstract method method() → core::String;
+}
+
+constants {
+ #C1 = "hello"
+}
diff --git a/pkg/front_end/testcases/nnbd/issue41210b_lib1.dart b/pkg/front_end/testcases/nnbd/issue41210b_lib1.dart
new file mode 100644
index 0000000..97b5964
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41210b_lib1.dart
@@ -0,0 +1,15 @@
+// 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.6
+
+import 'issue41210b_lib2.dart';
+
+mixin A implements Interface {
+ String method({String s = "hello"}) => s;
+}
+
+abstract class B implements Interface {}
+
+void main() {}
diff --git a/pkg/front_end/testcases/nnbd/issue41210b_lib2.dart b/pkg/front_end/testcases/nnbd/issue41210b_lib2.dart
new file mode 100644
index 0000000..3f2afd0
--- /dev/null
+++ b/pkg/front_end/testcases/nnbd/issue41210b_lib2.dart
@@ -0,0 +1,7 @@
+// 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.
+
+abstract class Interface {
+ String method();
+}
diff --git a/pkg/front_end/testcases/outline.status b/pkg/front_end/testcases/outline.status
index 47a606d..6d3a0e2 100644
--- a/pkg/front_end/testcases/outline.status
+++ b/pkg/front_end/testcases/outline.status
@@ -7,6 +7,9 @@
general/bug30695: TypeCheckError
general/infer_field_from_multiple: TypeCheckError
general/invalid_operator: TypeCheckError
+general/issue41210a: TypeCheckError
+general/issue41210b/issue41210: TypeCheckError
+
general/mixin_application_override: TypeCheckError
general/override_check_accessor_after_inference: TypeCheckError
general/override_check_accessor_basic: TypeCheckError
@@ -46,6 +49,8 @@
nnbd/messages_with_types_opt_in: TypeCheckError
nnbd/messages_with_types_opt_out: TypeCheckError
nnbd/never_opt_out: TypeCheckError
+nnbd/issue41210a/issue41210: TypeCheckError
+nnbd/issue41210b: TypeCheckError
rasta/native_is_illegal: Pass # Issue 29763
diff --git a/pkg/front_end/testcases/strong.status b/pkg/front_end/testcases/strong.status
index 41330d4..61f29c9e 100644
--- a/pkg/front_end/testcases/strong.status
+++ b/pkg/front_end/testcases/strong.status
@@ -41,6 +41,8 @@
general/issue38938: RuntimeError # no main and compile time errors.
general/issue38944: RuntimeError # no main and compile time errors.
general/issue38961: RuntimeError # no main and compile time errors.
+general/issue41210a: TypeCheckError
+general/issue41210b/issue41210: TypeCheckError
general/micro: RuntimeError
general/mixin_application_override: ExpectationFileMismatch # Too many errors.
general/mixin_application_override: TypeCheckError
@@ -139,6 +141,8 @@
instantiate_to_bound/non_simple_generic_function_in_bound_regress: RuntimeError # Expected
nnbd/inheritance_from_opt_in: TypeCheckError
nnbd/issue41180: RuntimeError # Strong mode runtime checking fails due to mixed strong mode.
+nnbd/issue41210a/issue41210: TypeCheckError
+nnbd/issue41210b: TypeCheckError
nnbd/messages_with_types_opt_in: TypeCheckError
nnbd/messages_with_types_opt_out: TypeCheckError
nnbd/never_opt_out: TypeCheckError
diff --git a/pkg/front_end/testcases/text_serialization.status b/pkg/front_end/testcases/text_serialization.status
index a3cf4cb..9e2e2bb 100644
--- a/pkg/front_end/testcases/text_serialization.status
+++ b/pkg/front_end/testcases/text_serialization.status
@@ -250,6 +250,8 @@
general/issue40662: TextSerializationFailure
general/issue40744: TextSerializationFailure
general/issue41070: TextSerializationFailure
+general/issue41210a: TypeCheckError
+general/issue41210b/issue41210: TypeCheckError
general/literals: TextSerializationFailure # Was: Pass
general/local_generic_function: TextSerializationFailure # Was: Pass
general/long_chain_of_typedefs: TextSerializationFailure
@@ -1296,6 +1298,8 @@
nnbd/issue41103: TextSerializationFailure
nnbd/issue41156: TextSerializationFailure
nnbd/issue41180: TextSerializationFailure
+nnbd/issue41210a/issue41210: TypeCheckError
+nnbd/issue41210b: TypeCheckError
nnbd/issue_39286: TextSerializationFailure
nnbd/issue_39286_2: TextSerializationFailure
nnbd/late: TextSerializationFailure
diff --git a/pkg/front_end/testcases/weak.status b/pkg/front_end/testcases/weak.status
index f3f40b2..4a52efa 100644
--- a/pkg/front_end/testcases/weak.status
+++ b/pkg/front_end/testcases/weak.status
@@ -61,4 +61,6 @@
nnbd/inheritance_from_opt_in: TypeCheckError
nnbd/messages_with_types_opt_in: TypeCheckError
nnbd/messages_with_types_opt_out: TypeCheckError
-nnbd/never_opt_out: TypeCheckError
\ No newline at end of file
+nnbd/never_opt_out: TypeCheckError
+nnbd/issue41210a/issue41210: TypeCheckError
+nnbd/issue41210b: TypeCheckError