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

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

Issue 1956973002: Fix InstanceFieldResolverVisitor to update element model. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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/resolver.dart
diff --git a/pkg/analyzer/lib/src/generated/resolver.dart b/pkg/analyzer/lib/src/generated/resolver.dart
index 7f00554dff199a83c5216a2dca643eaf51cbced1..c7c9bb61fa7d6a612cbb1ae4cab36577cfe71f8c 100644
--- a/pkg/analyzer/lib/src/generated/resolver.dart
+++ b/pkg/analyzer/lib/src/generated/resolver.dart
@@ -4995,7 +4995,14 @@ class InstanceFieldResolverVisitor extends ResolverVisitor {
void _resolveFieldDeclaration(FieldDeclaration node) {
if (!node.isStatic) {
for (VariableDeclaration field in node.fields.variables) {
- field.initializer?.accept(this);
+ if (field.initializer != null) {
+ field.initializer.accept(this);
+ FieldElement fieldElement = field.name.staticElement;
+ if (fieldElement.initializer != null) {
+ (fieldElement.initializer as ExecutableElementImpl).returnType =
+ field.initializer.staticType;
+ }
+ }
}
}
}
« 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