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

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

Issue 2918913003: Handle list and map literals (Closed)
Patch Set: Updated cf. comments Created 3 years, 6 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
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 dart2js.resolution.compute_members; 5 part of dart2js.resolution.compute_members;
6 6
7 class DeclaredMember implements Member { 7 class DeclaredMember implements Member {
8 final Name name; 8 final Name name;
9 final Element element; 9 final Element element;
10 final ResolutionInterfaceType declarer; 10 final ResolutionInterfaceType declarer;
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 ResolutionFunctionType get functionType { 141 ResolutionFunctionType get functionType {
142 return declaration.functionType.substByContext(instance); 142 return declaration.functionType.substByContext(instance);
143 } 143 }
144 144
145 DeclaredMember inheritFrom(ResolutionInterfaceType newInstance) { 145 DeclaredMember inheritFrom(ResolutionInterfaceType newInstance) {
146 assert(() { 146 assert(() {
147 // Assert that if [instance] contains type variables, then these are 147 // Assert that if [instance] contains type variables, then these are
148 // defined in the declaration of [newInstance] and will therefore be 148 // defined in the declaration of [newInstance] and will therefore be
149 // substituted into the context of [newInstance] in the created member. 149 // substituted into the context of [newInstance] in the created member.
150 ClassElement contextClass = Types.getClassContext(instance); 150 ClassElement contextClass = DartTypes.getClassContext(instance);
151 return contextClass == null || contextClass == newInstance.element; 151 return contextClass == null || contextClass == newInstance.element;
152 }, 152 },
153 failedAt( 153 failedAt(
154 declaration.element, 154 declaration.element,
155 "Context mismatch: Context class " 155 "Context mismatch: Context class "
156 "${Types.getClassContext(instance)} from $instance does match " 156 "${DartTypes.getClassContext(instance)} from $instance does match "
157 "the new instance $newInstance.")); 157 "the new instance $newInstance."));
158 return _newInheritedMember(newInstance); 158 return _newInheritedMember(newInstance);
159 } 159 }
160 160
161 InheritedMember _newInheritedMember(ResolutionInterfaceType newInstance) { 161 InheritedMember _newInheritedMember(ResolutionInterfaceType newInstance) {
162 return new InheritedMember( 162 return new InheritedMember(
163 declaration, instance.substByContext(newInstance)); 163 declaration, instance.substByContext(newInstance));
164 } 164 }
165 165
166 Iterable<Member> get declarations => <Member>[this]; 166 Iterable<Member> get declarations => <Member>[this];
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 247
248 bool get isGetter => false; 248 bool get isGetter => false;
249 249
250 bool get isMethod => false; 250 bool get isMethod => false;
251 251
252 bool get isMalformed => true; 252 bool get isMalformed => true;
253 253
254 String toString() => "erroneous member '$name' synthesized " 254 String toString() => "erroneous member '$name' synthesized "
255 "from ${inheritedMembers}"; 255 "from ${inheritedMembers}";
256 } 256 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/resolution/class_members.dart ('k') | pkg/compiler/lib/src/resolution/type_resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698