File tree 2 files changed +16
-0
lines changed 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -670,6 +670,12 @@ class CodeChecker extends RecursiveAstVisitor {
670
670
node.visitChildren (this );
671
671
}
672
672
673
+ @override
674
+ void visitAwaitExpression (AwaitExpression node) {
675
+ checkAssignment (node.expression, _rules.provider.futureDynamicType);
676
+ node.visitChildren (this );
677
+ }
678
+
673
679
@override
674
680
void visitPropertyAccess (PropertyAccess node) {
675
681
var target = node.realTarget;
Original file line number Diff line number Diff line change @@ -2686,6 +2686,16 @@ void main() {
2686
2686
Future bar2() async { return x; }
2687
2687
Future<int> bar3() async { return (/*info:DynamicCast*/x); }
2688
2688
Future<int> bar4() async { return (/*severe:StaticTypeError*/new Future<int>(x)); }
2689
+
2690
+ int y;
2691
+ Future<int> z;
2692
+
2693
+ void baz() async {
2694
+ int a = /*info:DynamicCast*/await /*info:DynamicCast*/x;
2695
+ int b = await /*severe:StaticTypeError*/y;
2696
+ int c = await z;
2697
+ String d = /*severe:StaticTypeError*/await z;
2698
+ }
2689
2699
'''
2690
2700
}));
2691
2701
You can’t perform that action at this time.
0 commit comments