OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |