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

Side by Side Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 2439023002: Fix static modifier for synthetic fields coming from summaries. (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_common.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.dart.element.element; 5 library analyzer.src.dart.element.element;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:math' show min; 8 import 'dart:math' show min;
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 // Create or update the implicit field. 1229 // Create or update the implicit field.
1230 String fieldName = accessor.displayName; 1230 String fieldName = accessor.displayName;
1231 FieldElementImpl field = implicitFields[fieldName]; 1231 FieldElementImpl field = implicitFields[fieldName];
1232 if (field == null) { 1232 if (field == null) {
1233 field = new FieldElementImpl(fieldName, -1); 1233 field = new FieldElementImpl(fieldName, -1);
1234 implicitFields[fieldName] = field; 1234 implicitFields[fieldName] = field;
1235 field.enclosingElement = this; 1235 field.enclosingElement = this;
1236 field.synthetic = true; 1236 field.synthetic = true;
1237 field.final2 = e.kind == UnlinkedExecutableKind.getter; 1237 field.final2 = e.kind == UnlinkedExecutableKind.getter;
1238 field.type = fieldType; 1238 field.type = fieldType;
1239 field.static = e.isStatic;
1239 } else { 1240 } else {
1240 field.final2 = false; 1241 field.final2 = false;
1241 } 1242 }
1242 accessor.variable = field; 1243 accessor.variable = field;
1243 if (e.kind == UnlinkedExecutableKind.getter) { 1244 if (e.kind == UnlinkedExecutableKind.getter) {
1244 field.getter = accessor; 1245 field.getter = accessor;
1245 } else { 1246 } else {
1246 field.setter = accessor; 1247 field.setter = accessor;
1247 } 1248 }
1248 } 1249 }
(...skipping 7203 matching lines...) Expand 10 before | Expand all | Expand 10 after
8452 8453
8453 @override 8454 @override
8454 void visitElement(Element element) { 8455 void visitElement(Element element) {
8455 int offset = element.nameOffset; 8456 int offset = element.nameOffset;
8456 if (offset != -1) { 8457 if (offset != -1) {
8457 map[offset] = element; 8458 map[offset] = element;
8458 } 8459 }
8459 super.visitElement(element); 8460 super.visitElement(element);
8460 } 8461 }
8461 } 8462 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/resynthesize_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698