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 1850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1861 KernelSymbolLiteral(String value) : super(value); | 1861 KernelSymbolLiteral(String value) : super(value); |
1862 | 1862 |
1863 @override | 1863 @override |
1864 void _collectDependencies(KernelDependencyCollector collector) { | 1864 void _collectDependencies(KernelDependencyCollector collector) { |
1865 // No inference dependencies. | 1865 // No inference dependencies. |
1866 } | 1866 } |
1867 | 1867 |
1868 @override | 1868 @override |
1869 DartType _inferExpression( | 1869 DartType _inferExpression( |
1870 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { | 1870 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { |
1871 // TODO(scheglov): implement. | 1871 typeNeeded = |
1872 return typeNeeded ? const DynamicType() : null; | 1872 inferrer.listener.symbolLiteralEnter(this, typeContext) || typeNeeded; |
| 1873 var inferredType = |
| 1874 typeNeeded ? inferrer.coreTypes.symbolClass.rawType : null; |
| 1875 inferrer.listener.symbolLiteralExit(this, inferredType); |
| 1876 return inferredType; |
1873 } | 1877 } |
1874 } | 1878 } |
1875 | 1879 |
1876 /// Shadow object for [ThisExpression]. | 1880 /// Shadow object for [ThisExpression]. |
1877 class KernelThisExpression extends ThisExpression implements KernelExpression { | 1881 class KernelThisExpression extends ThisExpression implements KernelExpression { |
1878 @override | 1882 @override |
1879 void _collectDependencies(KernelDependencyCollector collector) { | 1883 void _collectDependencies(KernelDependencyCollector collector) { |
1880 // Field initializers are not allowed to refer to [this]. But if it | 1884 // Field initializers are not allowed to refer to [this]. But if it |
1881 // happens, we can still proceed; no additional type inference dependencies | 1885 // happens, we can still proceed; no additional type inference dependencies |
1882 // are introduced. | 1886 // are introduced. |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2324 } | 2328 } |
2325 | 2329 |
2326 transformChildren(v) { | 2330 transformChildren(v) { |
2327 return internalError("Internal error: Unsupported operation."); | 2331 return internalError("Internal error: Unsupported operation."); |
2328 } | 2332 } |
2329 | 2333 |
2330 visitChildren(v) { | 2334 visitChildren(v) { |
2331 return internalError("Internal error: Unsupported operation."); | 2335 return internalError("Internal error: Unsupported operation."); |
2332 } | 2336 } |
2333 } | 2337 } |
OLD | NEW |