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

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart

Issue 2952883004: Fix type inference of PropertySet when the receiver is a generic class. (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | pkg/front_end/test/fasta/strong.status » ('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) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, 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 /// This file declares a "shadow hierarchy" of concrete classes which extend 5 /// This file declares a "shadow hierarchy" of concrete classes which extend
6 /// the kernel class hierarchy, adding methods and fields needed by the 6 /// the kernel class hierarchy, adding methods and fields needed by the
7 /// BodyBuilder. 7 /// BodyBuilder.
8 /// 8 ///
9 /// Instances of these classes may be created using the factory methods in 9 /// Instances of these classes may be created using the factory methods in
10 /// `ast_factory.dart`. 10 /// `ast_factory.dart`.
(...skipping 1427 matching lines...) Expand 10 before | Expand all | Expand 10 after
1438 } else { 1438 } else {
1439 // References to fields and setters can't be relied upon for top level 1439 // References to fields and setters can't be relied upon for top level
1440 // inference. 1440 // inference.
1441 inferrer.recordNotImmediatelyEvident(fileOffset); 1441 inferrer.recordNotImmediatelyEvident(fileOffset);
1442 } 1442 }
1443 } 1443 }
1444 } 1444 }
1445 // To replicate analyzer behavior, we base type inference on the write 1445 // To replicate analyzer behavior, we base type inference on the write
1446 // member. TODO(paulberry): would it be better to use the read member when 1446 // member. TODO(paulberry): would it be better to use the read member when
1447 // doing compound assignment? 1447 // doing compound assignment?
1448 var writeContext = writeMember?.setterType; 1448 var writeContext = inferrer.getSetterType(writeMember, receiverType);
1449 var inferredType = _inferRhs(inferrer, writeContext); 1449 var inferredType = _inferRhs(inferrer, writeContext);
1450 inferrer.listener.propertyAssignExit(desugared, inferredType); 1450 inferrer.listener.propertyAssignExit(desugared, inferredType);
1451 return inferredType; 1451 return inferredType;
1452 } 1452 }
1453 } 1453 }
1454 1454
1455 /// Shadow object for [PropertyGet]. 1455 /// Shadow object for [PropertyGet].
1456 class KernelPropertyGet extends PropertyGet implements KernelExpression { 1456 class KernelPropertyGet extends PropertyGet implements KernelExpression {
1457 KernelPropertyGet(Expression receiver, Name name, [Member interfaceTarget]) 1457 KernelPropertyGet(Expression receiver, Name name, [Member interfaceTarget])
1458 : super(receiver, name, interfaceTarget); 1458 : super(receiver, name, interfaceTarget);
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
2216 } 2216 }
2217 2217
2218 transformChildren(v) { 2218 transformChildren(v) {
2219 return internalError("Internal error: Unsupported operation."); 2219 return internalError("Internal error: Unsupported operation.");
2220 } 2220 }
2221 2221
2222 visitChildren(v) { 2222 visitChildren(v) {
2223 return internalError("Internal error: Unsupported operation."); 2223 return internalError("Internal error: Unsupported operation.");
2224 } 2224 }
2225 } 2225 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/test/fasta/strong.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698