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

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

Issue 1673913002: Separate CONSTANT_EXPRESSION_RESOLVED flag from RESOLVED_UNITx. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | pkg/analyzer/lib/src/generated/incremental_resolver.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/constant.dart
diff --git a/pkg/analyzer/lib/src/generated/constant.dart b/pkg/analyzer/lib/src/generated/constant.dart
index fe641dba075c7d993a63135fd4ce936ea53db7f7..c67956cb2a0fb021e1f7a6145f8aea0d983d10d1 100644
--- a/pkg/analyzer/lib/src/generated/constant.dart
+++ b/pkg/analyzer/lib/src/generated/constant.dart
@@ -237,7 +237,7 @@ class ConstantEvaluationEngine {
final TypeProvider typeProvider;
/**
- * The type system. This is used to gues the types of constants when their
+ * The type system. This is used to guess the types of constants when their
* exact value is unknown.
*/
final TypeSystem typeSystem;
@@ -426,7 +426,7 @@ class ConstantEvaluationEngine {
} else if (constant is VariableElement) {
// constant is a VariableElement but not a VariableElementImpl. This can
// happen sometimes in the case of invalid user code (for example, a
- // constant expression that refers to a nonstatic field inside a generic
+ // constant expression that refers to a non-static field inside a generic
// class will wind up referring to a FieldMember). The error is detected
// elsewhere, so just silently ignore it here.
} else {
@@ -446,14 +446,7 @@ class ConstantEvaluationEngine {
void computeDependencies(
ConstantEvaluationTarget constant, ReferenceFinderCallback callback) {
ReferenceFinder referenceFinder = new ReferenceFinder(callback);
- if (constant is ParameterElementImpl) {
- if (constant.initializer != null) {
- Expression defaultValue = constant.constantInitializer;
- if (defaultValue != null) {
- defaultValue.accept(referenceFinder);
- }
- }
- } else if (constant is VariableElementImpl) {
+ if (constant is VariableElementImpl) {
Expression initializer = constant.constantInitializer;
if (initializer != null) {
initializer.accept(referenceFinder);
@@ -465,8 +458,7 @@ class ConstantEvaluationEngine {
getConstRedirectedConstructor(constant);
if (redirectedConstructor != null) {
ConstructorElement redirectedConstructorBase =
- ConstantEvaluationEngine
- ._getConstructorBase(redirectedConstructor);
+ _getConstructorBase(redirectedConstructor);
callback(redirectedConstructorBase);
return;
} else if (constant.isFactory) {
@@ -494,8 +486,8 @@ class ConstantEvaluationEngine {
InterfaceType superclass =
(constant.returnType as InterfaceType).superclass;
if (superclass != null && !superclass.isObject) {
- ConstructorElement unnamedConstructor = ConstantEvaluationEngine
- ._getConstructorBase(superclass.element.unnamedConstructor);
+ ConstructorElement unnamedConstructor =
+ _getConstructorBase(superclass.element.unnamedConstructor);
if (unnamedConstructor != null) {
callback(unnamedConstructor);
}
@@ -536,7 +528,7 @@ class ConstantEvaluationEngine {
} else if (constant is VariableElement) {
// constant is a VariableElement but not a VariableElementImpl. This can
// happen sometimes in the case of invalid user code (for example, a
- // constant expression that refers to a nonstatic field inside a generic
+ // constant expression that refers to a non-static field inside a generic
// class will wind up referring to a FieldMember). So just don't bother
// computing any dependencies.
} else {
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/incremental_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698