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

Unified Diff: lib/src/compiler/js_field_storage.dart

Issue 1927353002: Use lazy static fields when overriding static getters or setters. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « lib/src/compiler/code_generator.dart ('k') | test/codegen/language/static_field_override1_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/compiler/js_field_storage.dart
diff --git a/lib/src/compiler/js_field_storage.dart b/lib/src/compiler/js_field_storage.dart
index 7a4b0174922966982c31fcb40a9c3049e209a349..29b5a77a67e7c72438a33d665d6091da1679a69a 100644
--- a/lib/src/compiler/js_field_storage.dart
+++ b/lib/src/compiler/js_field_storage.dart
@@ -28,6 +28,10 @@ PropertyOverrideResult checkForPropertyOverride(FieldElement field,
var superprop = getProperty(superclass, field.library, field.name);
if (superprop == null) continue;
+ // Static fields can override superclass static fields. However, we need to
+ // handle the case where they override a getter or setter.
+ if (field.isStatic && !superprop.isSynthetic) continue;
+
var getter = superprop.getter;
bool hasGetter = getter != null && !getter.isAbstract;
if (hasGetter) foundGetter = true;
« no previous file with comments | « lib/src/compiler/code_generator.dart ('k') | test/codegen/language/static_field_override1_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698