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

Unified Diff: pkg/compiler/lib/src/resolution/constructors.dart

Issue 2118763002: Revert "Handle fields with initializers in constant constructors." (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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/compiler/lib/src/resolution/constructors.dart
diff --git a/pkg/compiler/lib/src/resolution/constructors.dart b/pkg/compiler/lib/src/resolution/constructors.dart
index 90f471633992735dbb78284087be70a589fa56e6..e30cfdcd7e496a70befa528d5db98275db08b9fc 100644
--- a/pkg/compiler/lib/src/resolution/constructors.dart
+++ b/pkg/compiler/lib/src/resolution/constructors.dart
@@ -448,24 +448,11 @@ class InitializerResolver {
constructorInvocation = resolveImplicitSuperConstructorSend();
}
if (isConst && isValidAsConstant) {
- constructor.enclosingClass.forEachInstanceField((_, FieldElement field) {
- if (!fieldInitializers.containsKey(field)) {
- visitor.resolution.ensureResolved(field);
- // TODO(johnniwinther): Report error if `field.constant` is `null`.
- if (field.constant != null) {
- fieldInitializers[field] = field.constant;
- } else {
- isValidAsConstant = false;
- }
- }
- });
- if (isValidAsConstant) {
- constructor.constantConstructor = new GenerativeConstantConstructor(
- constructor.enclosingClass.thisType,
- defaultValues,
- fieldInitializers,
- constructorInvocation);
- }
+ constructor.constantConstructor = new GenerativeConstantConstructor(
+ constructor.enclosingClass.thisType,
+ defaultValues,
+ fieldInitializers,
+ constructorInvocation);
}
visitor.scope = oldScope;
return null; // If there was no redirection always return null.
« no previous file with comments | « pkg/compiler/lib/src/inferrer/type_graph_inferrer.dart ('k') | pkg/compiler/lib/src/resolution/resolution.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698