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 1963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1974 KernelTypeLiteral(DartType type) : super(type); | 1974 KernelTypeLiteral(DartType type) : super(type); |
1975 | 1975 |
1976 @override | 1976 @override |
1977 void _collectDependencies(KernelDependencyCollector collector) { | 1977 void _collectDependencies(KernelDependencyCollector collector) { |
1978 // No inference dependencies. | 1978 // No inference dependencies. |
1979 } | 1979 } |
1980 | 1980 |
1981 @override | 1981 @override |
1982 DartType _inferExpression( | 1982 DartType _inferExpression( |
1983 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { | 1983 KernelTypeInferrer inferrer, DartType typeContext, bool typeNeeded) { |
1984 // TODO(scheglov): implement. | 1984 return typeNeeded ? inferrer.coreTypes.typeClass.rawType : null; |
1985 return typeNeeded ? const DynamicType() : null; | |
1986 } | 1985 } |
1987 } | 1986 } |
1988 | 1987 |
1989 /// Concrete implementation of [TypePromoter] specialized to work with kernel | 1988 /// Concrete implementation of [TypePromoter] specialized to work with kernel |
1990 /// objects. | 1989 /// objects. |
1991 class KernelTypePromoter extends TypePromoterImpl { | 1990 class KernelTypePromoter extends TypePromoterImpl { |
1992 @override | 1991 @override |
1993 int getVariableFunctionNestingLevel(VariableDeclaration variable) { | 1992 int getVariableFunctionNestingLevel(VariableDeclaration variable) { |
1994 if (variable is KernelVariableDeclaration) { | 1993 if (variable is KernelVariableDeclaration) { |
1995 return variable._functionNestingLevel; | 1994 return variable._functionNestingLevel; |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2216 } | 2215 } |
2217 | 2216 |
2218 transformChildren(v) { | 2217 transformChildren(v) { |
2219 return internalError("Internal error: Unsupported operation."); | 2218 return internalError("Internal error: Unsupported operation."); |
2220 } | 2219 } |
2221 | 2220 |
2222 visitChildren(v) { | 2221 visitChildren(v) { |
2223 return internalError("Internal error: Unsupported operation."); | 2222 return internalError("Internal error: Unsupported operation."); |
2224 } | 2223 } |
2225 } | 2224 } |
OLD | NEW |