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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/kernel_class_builder.dart

Issue 2938423003: Implement override-based inference of instance fields. (Closed)
Patch Set: 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/front_end/lib/src/fasta/kernel/kernel_class_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_class_builder.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_class_builder.dart
index 5043976aa7dacfcf7ebe2cc4279e00a8d33995d8..9709113adbd04a55b039830306f09c876111aaba 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_class_builder.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_class_builder.dart
@@ -4,6 +4,9 @@
library fasta.kernel_class_builder;
+import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart'
+ show KernelField;
+
import 'package:kernel/ast.dart'
show
Class,
@@ -195,6 +198,13 @@ abstract class KernelClassBuilder
}
}
// TODO(ahe): Handle other cases: accessors, operators, and fields.
+
+ // Also record any cases where a field overrides something in a superclass,
+ // since this information will be needed for type inference.
+ if (declaredMember is KernelField &&
+ identical(declaredMember.enclosingClass, cls)) {
+ KernelField.recordOverride(declaredMember, interfaceMember, isSetter);
+ }
}
void checkMethodOverride(

Powered by Google App Engine
This is Rietveld 408576698