Abstract noSuchMethod might not be an error.
Change-Id: Ie17371338a79d416f5bb8ccbae2b22cc2021a5b0
Reviewed-on: https://dart-review.googlesource.com/c/88835
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
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 a6c5dc6..e855fc7 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
@@ -112,21 +112,14 @@
]);
}
}
- Member aTarget = a.target;
- Member bTarget = b.target;
- if (mergeKind == MergeKind.superclass &&
- aTarget.name == noSuchMethodName &&
- !aTarget.isAbstract) {
- hasNoSuchMethod = true;
- }
Declaration result = a;
if (mergeKind == MergeKind.interfaces) {
// TODO(ahe): Combine the signatures of a and b. See the section named
// "Combined Member Signatures" in [Dart Programming Language
// Specification](
// ../../../../../../docs/language/dartLangSpec.tex#combinedMemberSignatures).
- } else if (aTarget.isAbstract) {
- if (mergeKind == MergeKind.superclass && !bTarget.isAbstract) {
+ } else if (a.target.isAbstract) {
+ if (mergeKind == MergeKind.superclass && !b.target.isAbstract) {
// An abstract method doesn't override an implemention inherited from a
// superclass.
result = b;
@@ -134,6 +127,13 @@
(abstractMembers ??= <Declaration>[]).add(a);
}
}
+
+ if (mergeKind == MergeKind.superclass &&
+ result.fullNameForErrors == noSuchMethodName.name &&
+ result.parent != objectClass) {
+ hasNoSuchMethod = true;
+ }
+
return result;
}
diff --git a/pkg/front_end/testcases/abstract_members.dart b/pkg/front_end/testcases/abstract_members.dart
index 00f4f14..058cbe9 100644
--- a/pkg/front_end/testcases/abstract_members.dart
+++ b/pkg/front_end/testcases/abstract_members.dart
@@ -38,4 +38,21 @@
cMethod() {}
}
+// This class should have no errors, as it has a non-trivial noSuchMethod.
+class MyMock1 extends B {
+ noSuchMethod(_) => null;
+}
+
+// This class should have no errors, as the abstract method doesn't override
+// the non-trivial noSuchMethod inherited from MyMock1.
+class MyMock2 extends MyMock1 {
+ noSuchMethod(_);
+}
+
+// This class should have an error, the abstract method isn't considered
+// non-trivial.
+class MyMock3 extends B {
+ noSuchMethod(_);
+}
+
main() {}
diff --git a/pkg/front_end/testcases/abstract_members.dart.legacy.expect b/pkg/front_end/testcases/abstract_members.dart.legacy.expect
index ae7e4d9..0c85dd2 100644
--- a/pkg/front_end/testcases/abstract_members.dart.legacy.expect
+++ b/pkg/front_end/testcases/abstract_members.dart.legacy.expect
@@ -47,6 +47,48 @@
// pkg/front_end/testcases/abstract_members.dart:16:8: Context: 'Interface3.interfaceMethod3' is defined here.
// void interfaceMethod3() {}
// ^^^^^^^^^^^^^^^^
+//
+// pkg/front_end/testcases/abstract_members.dart:54:7: Error: The non-abstract class 'MyMock3' is missing implementations for these members:
+// - A.abstractMethod
+// - A.property1=
+// - A.property2=
+// - A.property3=
+// - Interface1.interfaceMethod1
+// - Interface2.interfaceMethod1
+// - Interface2.interfaceMethod2
+// - Interface3.interfaceMethod3
+// Try to either
+// - provide an implementation,
+// - inherit an implementation from a superclass or mixin,
+// - mark the class as abstract, or
+// - provide a 'noSuchMethod' implementation.
+//
+// class MyMock3 extends B {
+// ^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:21:3: Context: 'A.abstractMethod' is defined here.
+// abstractMethod();
+// ^^^^^^^^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:22:12: Context: 'A.property1=' is defined here.
+// void set property1(_);
+// ^^^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:23:12: Context: 'A.property2=' is defined here.
+// void set property2(_);
+// ^^^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:24:12: Context: 'A.property3=' is defined here.
+// void set property3(_);
+// ^^^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:6:8: Context: 'Interface1.interfaceMethod1' is defined here.
+// void interfaceMethod1() {}
+// ^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:12:7: Context: 'Interface2.interfaceMethod1' is defined here.
+// var interfaceMethod1;
+// ^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:10:8: Context: 'Interface2.interfaceMethod2' is defined here.
+// void interfaceMethod2() {}
+// ^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:16:8: Context: 'Interface3.interfaceMethod3' is defined here.
+// void interfaceMethod3() {}
+// ^^^^^^^^^^^^^^^^
// Unhandled errors:
//
@@ -70,6 +112,24 @@
//
// class MyClass extends B {
// ^^^^^^^
+//
+// pkg/front_end/testcases/abstract_members.dart:54:7: Error: The non-abstract class 'MyMock3' is missing implementations for these members:
+// - A.abstractMethod
+// - A.property1=
+// - A.property2=
+// - A.property3=
+// - Interface1.interfaceMethod1
+// - Interface2.interfaceMethod1
+// - Interface2.interfaceMethod2
+// - Interface3.interfaceMethod3
+// Try to either
+// - provide an implementation,
+// - inherit an implementation from a superclass or mixin,
+// - mark the class as abstract, or
+// - provide a 'noSuchMethod' implementation.
+//
+// class MyMock3 extends B {
+// ^^^^^^^
library;
import self as self;
@@ -130,4 +190,49 @@
no-such-method-forwarder set property1(dynamic _) → void
return this.{core::Object::noSuchMethod}(new core::_InvocationMirror::_withType(#property1=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
}
+class MyMock1 extends self::B {
+ synthetic constructor •() → self::MyMock1
+ : super self::B::•()
+ ;
+ method noSuchMethod(dynamic _) → dynamic
+ return null;
+ no-such-method-forwarder method interfaceMethod2() → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod2, 0, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder method abstractMethod() → dynamic
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#abstractMethod, 0, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}))) as{TypeError} dynamic;
+ no-such-method-forwarder method interfaceMethod1() → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod1, 0, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder method interfaceMethod3() → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod3, 0, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set property3(dynamic _) → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#property3=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set interfaceMethod1(dynamic value) → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod1=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[value]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set property1(dynamic _) → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#property1=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set property2(dynamic _) → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#property2=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+}
+class MyMock2 extends self::MyMock1 {
+ synthetic constructor •() → self::MyMock2
+ : super self::MyMock1::•()
+ ;
+ abstract method noSuchMethod(dynamic _) → dynamic;
+}
+class MyMock3 extends self::B {
+ synthetic constructor •() → self::MyMock3
+ : super self::B::•()
+ ;
+ abstract method noSuchMethod(dynamic _) → dynamic;
+ no-such-method-forwarder get interfaceMethod1() → dynamic
+ return this.{self::MyMock3::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod1, 1, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}))) as{TypeError} dynamic;
+ no-such-method-forwarder set property3(dynamic _) → void
+ return this.{self::MyMock3::noSuchMethod}(new core::_InvocationMirror::_withType(#property3=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set interfaceMethod1(dynamic value) → void
+ return this.{self::MyMock3::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod1=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[value]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set property1(dynamic _) → void
+ return this.{self::MyMock3::noSuchMethod}(new core::_InvocationMirror::_withType(#property1=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set property2(dynamic _) → void
+ return this.{self::MyMock3::noSuchMethod}(new core::_InvocationMirror::_withType(#property2=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/abstract_members.dart.legacy.transformed.expect b/pkg/front_end/testcases/abstract_members.dart.legacy.transformed.expect
index 932cfc2..7e489f3 100644
--- a/pkg/front_end/testcases/abstract_members.dart.legacy.transformed.expect
+++ b/pkg/front_end/testcases/abstract_members.dart.legacy.transformed.expect
@@ -20,6 +20,24 @@
//
// class MyClass extends B {
// ^^^^^^^
+//
+// pkg/front_end/testcases/abstract_members.dart:54:7: Error: The non-abstract class 'MyMock3' is missing implementations for these members:
+// - A.abstractMethod
+// - A.property1=
+// - A.property2=
+// - A.property3=
+// - Interface1.interfaceMethod1
+// - Interface2.interfaceMethod1
+// - Interface2.interfaceMethod2
+// - Interface3.interfaceMethod3
+// Try to either
+// - provide an implementation,
+// - inherit an implementation from a superclass or mixin,
+// - mark the class as abstract, or
+// - provide a 'noSuchMethod' implementation.
+//
+// class MyMock3 extends B {
+// ^^^^^^^
library;
import self as self;
@@ -80,4 +98,49 @@
no-such-method-forwarder set property1(dynamic _) → void
return this.{core::Object::noSuchMethod}(new core::_InvocationMirror::_withType(#property1=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
}
+class MyMock1 extends self::B {
+ synthetic constructor •() → self::MyMock1
+ : super self::B::•()
+ ;
+ method noSuchMethod(dynamic _) → dynamic
+ return null;
+ no-such-method-forwarder method interfaceMethod2() → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod2, 0, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder method abstractMethod() → dynamic
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#abstractMethod, 0, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}))) as{TypeError} dynamic;
+ no-such-method-forwarder method interfaceMethod1() → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod1, 0, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder method interfaceMethod3() → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod3, 0, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set property3(dynamic _) → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#property3=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set interfaceMethod1(dynamic value) → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod1=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[value]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set property1(dynamic _) → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#property1=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set property2(dynamic _) → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#property2=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+}
+class MyMock2 extends self::MyMock1 {
+ synthetic constructor •() → self::MyMock2
+ : super self::MyMock1::•()
+ ;
+ abstract method noSuchMethod(dynamic _) → dynamic;
+}
+class MyMock3 extends self::B {
+ synthetic constructor •() → self::MyMock3
+ : super self::B::•()
+ ;
+ abstract method noSuchMethod(dynamic _) → dynamic;
+ no-such-method-forwarder get interfaceMethod1() → dynamic
+ return this.{self::MyMock3::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod1, 1, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}))) as{TypeError} dynamic;
+ no-such-method-forwarder set property3(dynamic _) → void
+ return this.{self::MyMock3::noSuchMethod}(new core::_InvocationMirror::_withType(#property3=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set interfaceMethod1(dynamic value) → void
+ return this.{self::MyMock3::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod1=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[value]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set property1(dynamic _) → void
+ return this.{self::MyMock3::noSuchMethod}(new core::_InvocationMirror::_withType(#property1=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set property2(dynamic _) → void
+ return this.{self::MyMock3::noSuchMethod}(new core::_InvocationMirror::_withType(#property2=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+}
static method main() → dynamic {}
diff --git a/pkg/front_end/testcases/abstract_members.dart.outline.expect b/pkg/front_end/testcases/abstract_members.dart.outline.expect
index 5b799a3..e2bf105 100644
--- a/pkg/front_end/testcases/abstract_members.dart.outline.expect
+++ b/pkg/front_end/testcases/abstract_members.dart.outline.expect
@@ -47,6 +47,48 @@
// pkg/front_end/testcases/abstract_members.dart:16:8: Context: 'Interface3.interfaceMethod3' is defined here.
// void interfaceMethod3() {}
// ^^^^^^^^^^^^^^^^
+//
+// pkg/front_end/testcases/abstract_members.dart:54:7: Error: The non-abstract class 'MyMock3' is missing implementations for these members:
+// - A.abstractMethod
+// - A.property1=
+// - A.property2=
+// - A.property3=
+// - Interface1.interfaceMethod1
+// - Interface2.interfaceMethod1
+// - Interface2.interfaceMethod2
+// - Interface3.interfaceMethod3
+// Try to either
+// - provide an implementation,
+// - inherit an implementation from a superclass or mixin,
+// - mark the class as abstract, or
+// - provide a 'noSuchMethod' implementation.
+//
+// class MyMock3 extends B {
+// ^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:21:3: Context: 'A.abstractMethod' is defined here.
+// abstractMethod();
+// ^^^^^^^^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:22:12: Context: 'A.property1=' is defined here.
+// void set property1(_);
+// ^^^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:23:12: Context: 'A.property2=' is defined here.
+// void set property2(_);
+// ^^^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:24:12: Context: 'A.property3=' is defined here.
+// void set property3(_);
+// ^^^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:6:8: Context: 'Interface1.interfaceMethod1' is defined here.
+// void interfaceMethod1() {}
+// ^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:12:7: Context: 'Interface2.interfaceMethod1' is defined here.
+// var interfaceMethod1;
+// ^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:10:8: Context: 'Interface2.interfaceMethod2' is defined here.
+// void interfaceMethod2() {}
+// ^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:16:8: Context: 'Interface3.interfaceMethod3' is defined here.
+// void interfaceMethod3() {}
+// ^^^^^^^^^^^^^^^^
library;
import self as self;
@@ -111,5 +153,47 @@
no-such-method-forwarder set property1(dynamic _) → void
return this.{core::Object::noSuchMethod}(new core::_InvocationMirror::_withType(#property1=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
}
+class MyMock1 extends self::B {
+ synthetic constructor •() → self::MyMock1
+ ;
+ method noSuchMethod(dynamic _) → dynamic
+ ;
+ no-such-method-forwarder method interfaceMethod2() → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod2, 0, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder method abstractMethod() → dynamic
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#abstractMethod, 0, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}))) as{TypeError} dynamic;
+ no-such-method-forwarder method interfaceMethod1() → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod1, 0, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder method interfaceMethod3() → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod3, 0, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set property3(dynamic _) → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#property3=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set interfaceMethod1(dynamic value) → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod1=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[value]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set property1(dynamic _) → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#property1=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set property2(dynamic _) → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#property2=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+}
+class MyMock2 extends self::MyMock1 {
+ synthetic constructor •() → self::MyMock2
+ ;
+ abstract method noSuchMethod(dynamic _) → dynamic;
+}
+class MyMock3 extends self::B {
+ synthetic constructor •() → self::MyMock3
+ ;
+ abstract method noSuchMethod(dynamic _) → dynamic;
+ no-such-method-forwarder get interfaceMethod1() → dynamic
+ return this.{self::MyMock3::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod1, 1, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}))) as{TypeError} dynamic;
+ no-such-method-forwarder set property3(dynamic _) → void
+ return this.{self::MyMock3::noSuchMethod}(new core::_InvocationMirror::_withType(#property3=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set interfaceMethod1(dynamic value) → void
+ return this.{self::MyMock3::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod1=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[value]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set property1(dynamic _) → void
+ return this.{self::MyMock3::noSuchMethod}(new core::_InvocationMirror::_withType(#property1=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set property2(dynamic _) → void
+ return this.{self::MyMock3::noSuchMethod}(new core::_InvocationMirror::_withType(#property2=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+}
static method main() → dynamic
;
diff --git a/pkg/front_end/testcases/abstract_members.dart.strong.expect b/pkg/front_end/testcases/abstract_members.dart.strong.expect
index 81ff760..c568386 100644
--- a/pkg/front_end/testcases/abstract_members.dart.strong.expect
+++ b/pkg/front_end/testcases/abstract_members.dart.strong.expect
@@ -51,6 +51,52 @@
// pkg/front_end/testcases/abstract_members.dart:22:12: Context: 'property1=' is defined here.
// void set property1(_);
// ^^^^^^^^^
+//
+// pkg/front_end/testcases/abstract_members.dart:54:7: Error: The non-abstract class 'MyMock3' is missing implementations for these members:
+// - 'interfaceMethod2'
+// - 'abstractMethod'
+// - 'interfaceMethod1'
+// - 'interfaceMethod1'
+// - 'interfaceMethod3'
+// - 'property3='
+// - 'interfaceMethod1='
+// - 'property1='
+// - 'property2='
+// Try to either
+// - provide an implementation,
+// - inherit an implementation from a superclass or mixin,
+// - mark the class as abstract, or
+// - provide a 'noSuchMethod' implementation.
+//
+// class MyMock3 extends B {
+// ^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:10:8: Context: 'interfaceMethod2' is defined here.
+// void interfaceMethod2() {}
+// ^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:21:3: Context: 'abstractMethod' is defined here.
+// abstractMethod();
+// ^^^^^^^^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:6:8: Context: 'interfaceMethod1' is defined here.
+// void interfaceMethod1() {}
+// ^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:12:7: Context: 'interfaceMethod1' is defined here.
+// var interfaceMethod1;
+// ^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:16:8: Context: 'interfaceMethod3' is defined here.
+// void interfaceMethod3() {}
+// ^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:24:12: Context: 'property3=' is defined here.
+// void set property3(_);
+// ^^^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:12:7: Context: 'interfaceMethod1=' is defined here.
+// var interfaceMethod1;
+// ^^^^^^^^^^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:22:12: Context: 'property1=' is defined here.
+// void set property1(_);
+// ^^^^^^^^^
+// pkg/front_end/testcases/abstract_members.dart:23:12: Context: 'property2=' is defined here.
+// void set property2(_);
+// ^^^^^^^^^
// Unhandled errors:
//
@@ -75,6 +121,25 @@
//
// class MyClass extends B {
// ^^^^^^^
+//
+// pkg/front_end/testcases/abstract_members.dart:54:7: Error: The non-abstract class 'MyMock3' is missing implementations for these members:
+// - 'interfaceMethod2'
+// - 'abstractMethod'
+// - 'interfaceMethod1'
+// - 'interfaceMethod1'
+// - 'interfaceMethod3'
+// - 'property3='
+// - 'interfaceMethod1='
+// - 'property1='
+// - 'property2='
+// Try to either
+// - provide an implementation,
+// - inherit an implementation from a superclass or mixin,
+// - mark the class as abstract, or
+// - provide a 'noSuchMethod' implementation.
+//
+// class MyMock3 extends B {
+// ^^^^^^^
library;
import self as self;
@@ -135,4 +200,49 @@
no-such-method-forwarder set property1(dynamic _) → void
return this.{core::Object::noSuchMethod}(new core::_InvocationMirror::_withType(#property1=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
}
+class MyMock1 extends self::B {
+ synthetic constructor •() → self::MyMock1
+ : super self::B::•()
+ ;
+ method noSuchMethod(core::Invocation _) → dynamic
+ return null;
+ no-such-method-forwarder method interfaceMethod2() → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod2, 0, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder method abstractMethod() → dynamic
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#abstractMethod, 0, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}))) as{TypeError} dynamic;
+ no-such-method-forwarder method interfaceMethod1() → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod1, 0, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder method interfaceMethod3() → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod3, 0, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set property3(dynamic _) → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#property3=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set interfaceMethod1(dynamic value) → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod1=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[value]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set property1(dynamic _) → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#property1=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set property2(dynamic _) → void
+ return this.{self::MyMock1::noSuchMethod}(new core::_InvocationMirror::_withType(#property2=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+}
+class MyMock2 extends self::MyMock1 {
+ synthetic constructor •() → self::MyMock2
+ : super self::MyMock1::•()
+ ;
+ abstract method noSuchMethod(core::Invocation _) → dynamic;
+}
+class MyMock3 extends self::B {
+ synthetic constructor •() → self::MyMock3
+ : super self::B::•()
+ ;
+ abstract method noSuchMethod(core::Invocation _) → dynamic;
+ no-such-method-forwarder get interfaceMethod1() → dynamic
+ return this.{self::MyMock3::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod1, 1, const <core::Type>[], const <dynamic>[], core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{}))) as{TypeError} dynamic;
+ no-such-method-forwarder set property3(dynamic _) → void
+ return this.{self::MyMock3::noSuchMethod}(new core::_InvocationMirror::_withType(#property3=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set interfaceMethod1(dynamic value) → void
+ return this.{self::MyMock3::noSuchMethod}(new core::_InvocationMirror::_withType(#interfaceMethod1=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[value]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set property1(dynamic _) → void
+ return this.{self::MyMock3::noSuchMethod}(new core::_InvocationMirror::_withType(#property1=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+ no-such-method-forwarder set property2(dynamic _) → void
+ return this.{self::MyMock3::noSuchMethod}(new core::_InvocationMirror::_withType(#property2=, 2, const <core::Type>[], core::List::unmodifiable<dynamic>(<dynamic>[_]), core::Map::unmodifiable<core::Symbol, dynamic>(const <core::Symbol, dynamic>{})));
+}
static method main() → dynamic {}