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

Unified Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 1531233002: Compute all default values of parameters. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years 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/analyzer/lib/src/generated/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 43b81e984cd71037817c59855ed580c028517f9d..f1688559d9a4c3ac42501a03e1ac9bb3a0fac2e2 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -8678,16 +8678,10 @@ class ResolverVisitor extends ScopedVisitor {
(element.initializer as FunctionElementImpl).returnType =
node.defaultValue.staticType;
}
- FormalParameterList parent = node.parent;
- AstNode grandparent = parent.parent;
- if (grandparent is ConstructorDeclaration &&
- grandparent.constKeyword != null) {
- // For const constructors, we need to clone the ASTs for default formal
- // parameters, so that we can use them during constant evaluation.
- ParameterElement element = node.element;
- (element as ConstVariableElement).constantInitializer =
- new ConstantAstCloner().cloneNode(node.defaultValue);
- }
+ // Clone the ASTs for default formal parameters, so that we can use them
+ // during constant evaluation.
+ (element as ConstVariableElement).constantInitializer =
+ new ConstantAstCloner().cloneNode(node.defaultValue);
return null;
}

Powered by Google App Engine
This is Rietveld 408576698