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

Side by Side Diff: pkg/kernel/lib/transformations/mixin_full_resolution.dart

Issue 2532573002: Set isSuper on accessors in no-such-method. (Closed)
Patch Set: Set isSuper on accessors in no-such-method. Created 3 years, 11 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 | no next file » | 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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 library kernel.transformations.mixin_full_resolution; 4 library kernel.transformations.mixin_full_resolution;
5 5
6 import '../ast.dart'; 6 import '../ast.dart';
7 import '../class_hierarchy.dart'; 7 import '../class_hierarchy.dart';
8 import '../clone.dart'; 8 import '../clone.dart';
9 import '../core_types.dart'; 9 import '../core_types.dart';
10 import '../type_algebra.dart'; 10 import '../type_algebra.dart';
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 this.hierarchy, this.coreTypes, this.lookupClass); 172 this.hierarchy, this.coreTypes, this.lookupClass);
173 173
174 TreeNode visit(TreeNode node) => node.accept(this); 174 TreeNode visit(TreeNode node) => node.accept(this);
175 175
176 visitSuperPropertyGet(SuperPropertyGet node) { 176 visitSuperPropertyGet(SuperPropertyGet node) {
177 Member target = hierarchy.getDispatchTarget(lookupClass, node.name); 177 Member target = hierarchy.getDispatchTarget(lookupClass, node.name);
178 if (target != null) { 178 if (target != null) {
179 return new DirectPropertyGet(new ThisExpression(), target); 179 return new DirectPropertyGet(new ThisExpression(), target);
180 } else { 180 } else {
181 return _callNoSuchMethod(node.name.name, new Arguments.empty(), node, 181 return _callNoSuchMethod(node.name.name, new Arguments.empty(), node,
182 isGetter: true); 182 isGetter: true, isSuper: true);
183 } 183 }
184 } 184 }
185 185
186 visitSuperPropertySet(SuperPropertySet node) { 186 visitSuperPropertySet(SuperPropertySet node) {
187 Member target = 187 Member target =
188 hierarchy.getDispatchTarget(lookupClass, node.name, setter: true); 188 hierarchy.getDispatchTarget(lookupClass, node.name, setter: true);
189 if (target != null) { 189 if (target != null) {
190 return new DirectPropertySet( 190 return new DirectPropertySet(
191 new ThisExpression(), target, visit(node.value)); 191 new ThisExpression(), target, visit(node.value));
192 } else { 192 } else {
193 // Call has to return right-hand-side. 193 // Call has to return right-hand-side.
194 VariableDeclaration rightHandSide = 194 VariableDeclaration rightHandSide =
195 new VariableDeclaration.forValue(visit(node.value)); 195 new VariableDeclaration.forValue(visit(node.value));
196 Expression result = _callNoSuchMethod( 196 Expression result = _callNoSuchMethod(
197 node.name.name, new Arguments([new VariableGet(rightHandSide)]), node, 197 node.name.name, new Arguments([new VariableGet(rightHandSide)]), node,
198 isSetter: true); 198 isSetter: true, isSuper: true);
199 VariableDeclaration call = new VariableDeclaration.forValue(result); 199 VariableDeclaration call = new VariableDeclaration.forValue(result);
200 return new Let( 200 return new Let(
201 rightHandSide, new Let(call, new VariableGet(rightHandSide))); 201 rightHandSide, new Let(call, new VariableGet(rightHandSide)));
202 } 202 }
203 } 203 }
204 204
205 visitSuperMethodInvocation(SuperMethodInvocation node) { 205 visitSuperMethodInvocation(SuperMethodInvocation node) {
206 Member target = hierarchy.getDispatchTarget(lookupClass, node.name); 206 Member target = hierarchy.getDispatchTarget(lookupClass, node.name);
207 Arguments visitedArguments = visit(node.arguments); 207 Arguments visitedArguments = visit(node.arguments);
208 if (target is Procedure && 208 if (target is Procedure &&
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 return null; 360 return null;
361 } 361 }
362 } 362 }
363 363
364 throw new Exception( 364 throw new Exception(
365 'Could not find a generative constructor named "${constructor.name}" ' 365 'Could not find a generative constructor named "${constructor.name}" '
366 'in lookup class "${lookupClass.name}"!'); 366 'in lookup class "${lookupClass.name}"!');
367 } 367 }
368 } 368 }
369 } 369 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698