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

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

Issue 2199903002: Create synthetic FieldElement(s) (don't use non-synthetic ones) for non-synthetic class getters/set… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/resolver.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.builder; 5 library analyzer.src.dart.element.builder;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after
969 } 969 }
970 if (node.returnType == null) { 970 if (node.returnType == null) {
971 element.hasImplicitReturnType = true; 971 element.hasImplicitReturnType = true;
972 } 972 }
973 _currentHolder.addMethod(element); 973 _currentHolder.addMethod(element);
974 methodName.staticElement = element; 974 methodName.staticElement = element;
975 } else { 975 } else {
976 SimpleIdentifier propertyNameNode = node.name; 976 SimpleIdentifier propertyNameNode = node.name;
977 String propertyName = propertyNameNode.name; 977 String propertyName = propertyNameNode.name;
978 FieldElementImpl field = 978 FieldElementImpl field =
979 _currentHolder.getField(propertyName) as FieldElementImpl; 979 _currentHolder.getField(propertyName, synthetic: true) as FieldEleme ntImpl;
980 if (field == null) { 980 if (field == null) {
981 field = new FieldElementImpl(node.name.name, -1); 981 field = new FieldElementImpl(node.name.name, -1);
982 field.final2 = true; 982 field.final2 = true;
983 field.static = isStatic; 983 field.static = isStatic;
984 field.synthetic = true; 984 field.synthetic = true;
985 _currentHolder.addField(field); 985 _currentHolder.addField(field);
986 } 986 }
987 if (node.isGetter) { 987 if (node.isGetter) {
988 PropertyAccessorElementImpl getter = 988 PropertyAccessorElementImpl getter =
989 new PropertyAccessorElementImpl.forNode(propertyNameNode); 989 new PropertyAccessorElementImpl.forNode(propertyNameNode);
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
1457 return null; 1457 return null;
1458 } 1458 }
1459 1459
1460 /** 1460 /**
1461 * Return the lexical identifiers associated with the given [identifiers]. 1461 * Return the lexical identifiers associated with the given [identifiers].
1462 */ 1462 */
1463 static List<String> _getIdentifiers(NodeList<SimpleIdentifier> identifiers) { 1463 static List<String> _getIdentifiers(NodeList<SimpleIdentifier> identifiers) {
1464 return identifiers.map((identifier) => identifier.name).toList(); 1464 return identifiers.map((identifier) => identifier.name).toList();
1465 } 1465 }
1466 } 1466 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698