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

Side by Side Diff: pkg/compiler/lib/src/resolution/members.dart

Issue 1132783002: Add Accessor, Getter, and Setter elements. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/compiler/lib/src/patch_parser.dart ('k') | pkg/compiler/lib/src/resolution/resolution.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of resolution; 5 part of resolution;
6 6
7 abstract class TreeElements { 7 abstract class TreeElements {
8 AnalyzableElement get analyzedElement; 8 AnalyzableElement get analyzedElement;
9 Iterable<Node> get superUses; 9 Iterable<Node> get superUses;
10 10
(...skipping 1138 matching lines...) Expand 10 before | Expand all | Expand 10 after
1149 if (lookupElement == null) { 1149 if (lookupElement == null) {
1150 compiler.internalError(member, 1150 compiler.internalError(member,
1151 "No abstract field for accessor"); 1151 "No abstract field for accessor");
1152 } else if (!identical(lookupElement.kind, ElementKind.ABSTRACT_FIELD)) { 1152 } else if (!identical(lookupElement.kind, ElementKind.ABSTRACT_FIELD)) {
1153 if (lookupElement.isErroneous || lookupElement.isAmbiguous) return; 1153 if (lookupElement.isErroneous || lookupElement.isAmbiguous) return;
1154 compiler.internalError(member, 1154 compiler.internalError(member,
1155 "Inaccessible abstract field for accessor"); 1155 "Inaccessible abstract field for accessor");
1156 } 1156 }
1157 AbstractFieldElement field = lookupElement; 1157 AbstractFieldElement field = lookupElement;
1158 1158
1159 FunctionElementX getter = field.getter; 1159 MethodElementX getter = field.getter;
1160 if (getter == null) return; 1160 if (getter == null) return;
1161 FunctionElementX setter = field.setter; 1161 MethodElementX setter = field.setter;
1162 if (setter == null) return; 1162 if (setter == null) return;
1163 int getterFlags = getter.modifiers.flags | Modifiers.FLAG_ABSTRACT; 1163 int getterFlags = getter.modifiers.flags | Modifiers.FLAG_ABSTRACT;
1164 int setterFlags = setter.modifiers.flags | Modifiers.FLAG_ABSTRACT; 1164 int setterFlags = setter.modifiers.flags | Modifiers.FLAG_ABSTRACT;
1165 if (!identical(getterFlags, setterFlags)) { 1165 if (!identical(getterFlags, setterFlags)) {
1166 final mismatchedFlags = 1166 final mismatchedFlags =
1167 new Modifiers.withFlags(null, getterFlags ^ setterFlags); 1167 new Modifiers.withFlags(null, getterFlags ^ setterFlags);
1168 compiler.reportError( 1168 compiler.reportError(
1169 field.getter, 1169 field.getter,
1170 MessageKind.GETTER_MISMATCH, 1170 MessageKind.GETTER_MISMATCH,
1171 {'modifiers': mismatchedFlags}); 1171 {'modifiers': mismatchedFlags});
(...skipping 3987 matching lines...) Expand 10 before | Expand all | Expand 10 after
5159 } 5159 }
5160 5160
5161 /// The result for the resolution of the `assert` method. 5161 /// The result for the resolution of the `assert` method.
5162 class AssertResult implements ResolutionResult { 5162 class AssertResult implements ResolutionResult {
5163 const AssertResult(); 5163 const AssertResult();
5164 5164
5165 Element get element => null; 5165 Element get element => null;
5166 5166
5167 String toString() => 'AssertResult()'; 5167 String toString() => 'AssertResult()';
5168 } 5168 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/patch_parser.dart ('k') | pkg/compiler/lib/src/resolution/resolution.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698