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

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

Issue 2207473004: fixes #26993, constant evaluation gets wrong type (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: rebase and sort Created 4 years, 4 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/test/src/task/strong/inferred_type_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/static_type_analyzer.dart
diff --git a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
index d144c76f7557c75bf2a87f763ba3b1a0467e231b..f68147180e5529973e12766669e0348cd963a001 100644
--- a/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
+++ b/pkg/analyzer/lib/src/generated/static_type_analyzer.dart
@@ -2011,7 +2011,11 @@ class StaticTypeAnalyzer extends SimpleAstVisitor<Object> {
arguments.correspondingStaticParameters = ResolverVisitor
.resolveArgumentsToParameters(arguments, inferred.parameters, null);
inferConstructorName(constructor, inferred.returnType);
- // TODO(jmesserly): should we fix up the staticElement as well?
+ // Update the static element as well. This is used in some cases, such as
+ // computing constant values. It is stored in two places.
+ constructor.staticElement =
+ ConstructorMember.from(rawElement, inferred.returnType);
+ node.staticElement = constructor.staticElement;
}
}
« no previous file with comments | « no previous file | pkg/analyzer/test/src/task/strong/inferred_type_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698