File tree Expand file tree Collapse file tree 2 files changed +5
-20
lines changed Expand file tree Collapse file tree 2 files changed +5
-20
lines changed Original file line number Diff line number Diff line change 2
2
// for details. All rights reserved. Use of this source code is governed by a
3
3
// BSD-style license that can be found in the LICENSE file.
4
4
5
- // @dart = 2.10
6
-
7
5
import 'package:kernel/ast.dart' as ir;
8
6
import 'package:kernel/type_environment.dart' as ir;
9
7
import 'static_type_base.dart' ;
@@ -25,24 +23,13 @@ class CachedStaticType extends StaticTypeBase implements StaticTypeProvider {
25
23
: super (staticTypeContext.typeEnvironment);
26
24
27
25
@override
28
- ir.DartType getStaticType (ir.Expression node) {
29
- ir.DartType type = node.accept (this );
30
- assert (type != null , "No static type found for ${node .runtimeType }." );
31
- return type;
32
- }
26
+ ir.DartType getStaticType (ir.Expression node) => node.accept (this )! ;
33
27
34
28
@override
35
- ir.DartType getForInIteratorType (ir.ForInStatement node) {
36
- ir.DartType type = _cache.getForInIteratorType (node);
37
- assert (type != null , "No for-in iterator type found for ${node }." );
38
- return type;
39
- }
29
+ ir.DartType getForInIteratorType (ir.ForInStatement node) =>
30
+ _cache.getForInIteratorType (node)! ;
40
31
41
- ir.DartType _getStaticType (ir.Expression node) {
42
- ir.DartType type = _cache[node];
43
- assert (type != null , "No static type cached for ${node .runtimeType }." );
44
- return type;
45
- }
32
+ ir.DartType _getStaticType (ir.Expression node) => _cache[node]! ;
46
33
47
34
@override
48
35
ir.DartType visitVariableGet (ir.VariableGet node) => _getStaticType (node);
Original file line number Diff line number Diff line change 2
2
// for details. All rights reserved. Use of this source code is governed by a
3
3
// BSD-style license that can be found in the LICENSE file.
4
4
5
- // @dart = 2.10
6
-
7
5
// TODO(sigmund): rename universe => world
8
6
/// Describes individual features that may be seen in a program. Most features
9
7
/// can be described only by name using the [Feature] enum, some features are
@@ -249,7 +247,7 @@ class GenericInstantiation {
249
247
250
248
factory GenericInstantiation .readFromDataSource (DataSourceReader source) {
251
249
source.begin (tag);
252
- DartType functionType = source.readDartType ();
250
+ final functionType = source.readDartType () as FunctionType ;
253
251
List <DartType > typeArguments = source.readDartTypes ();
254
252
source.end (tag);
255
253
return GenericInstantiation (functionType, typeArguments);
You can’t perform that action at this time.
0 commit comments