Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(578)

Unified Diff: pkg/kernel/lib/src/incremental_class_hierarchy.dart

Issue 2946733003: Fix type inference of getters that "override" setters and vice versa. (Closed)
Patch Set: Address code review comments Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/kernel/lib/src/incremental_class_hierarchy.dart
diff --git a/pkg/kernel/lib/src/incremental_class_hierarchy.dart b/pkg/kernel/lib/src/incremental_class_hierarchy.dart
index ce13ecf920a1a26266853de87feee3e92ec959f4..051aae18f61db5692b6ed52f17ae05f4cff69569 100644
--- a/pkg/kernel/lib/src/incremental_class_hierarchy.dart
+++ b/pkg/kernel/lib/src/incremental_class_hierarchy.dart
@@ -86,8 +86,7 @@ class IncrementalClassHierarchy implements ClassHierarchy {
@override
void forEachOverridePair(Class node,
- callback(Member declaredMember, Member interfaceMember, bool isSetter),
- {bool crossGettersSetters: false}) {
+ callback(Member declaredMember, Member interfaceMember, bool isSetter)) {
_ClassInfo info = _getInfo(node);
for (var supertype in node.supers) {
var superNode = supertype.classNode;
@@ -104,11 +103,6 @@ class IncrementalClassHierarchy implements ClassHierarchy {
isSetter: true);
_reportOverrides(info.declaredSetters, superSetters, callback,
isSetter: true, onlyAbstract: true);
-
- if (crossGettersSetters) {
- _reportOverrides(info.declaredGettersAndCalls, superSetters, callback);
- _reportOverrides(info.declaredSetters, superGetters, callback);
- }
}
if (!node.isAbstract) {
// If a non-abstract class declares an abstract method M whose
@@ -126,6 +120,24 @@ class IncrementalClassHierarchy implements ClassHierarchy {
}
}
+ @override
+ void forEachCrossOverridePair(Class node,
+ callback(Member declaredMember, Member interfaceMember, bool isSetter),
+ {bool crossGettersSetters: false}) {
+ _ClassInfo info = _getInfo(node);
+ for (var supertype in node.supers) {
+ var superNode = supertype.classNode;
+ var superInfo = _getInfo(superNode);
+
+ var superGetters = superInfo.interfaceGettersAndCalls;
+ var superSetters = superInfo.interfaceSetters;
+
+ _reportOverrides(info.declaredGettersAndCalls, superSetters, callback);
+ _reportOverrides(info.declaredSetters, superGetters, callback,
+ isSetter: true);
+ }
+ }
+
@override
Supertype getClassAsInstanceOf(Class node, Class superclass) {
if (identical(node, superclass)) return node.asThisSupertype;

Powered by Google App Engine
This is Rietveld 408576698