Skip to content

Commit bbf2920

Browse files
author
John Messerly
committed
allow await to be any value, fixes part of #264
Review URL: https://codereview.chromium.org/1248213002 .
1 parent 2652875 commit bbf2920

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

pkg/dev_compiler/lib/src/checker/checker.dart

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -669,12 +669,6 @@ class CodeChecker extends RecursiveAstVisitor {
669669
node.visitChildren(this);
670670
}
671671

672-
@override
673-
void visitAwaitExpression(AwaitExpression node) {
674-
checkAssignment(node.expression, rules.provider.futureDynamicType);
675-
node.visitChildren(this);
676-
}
677-
678672
@override
679673
void visitPropertyAccess(PropertyAccess node) {
680674
var target = node.realTarget;

pkg/dev_compiler/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: dev_compiler
2-
version: 0.1.2
2+
version: 0.1.3
33
description: >
44
Experimental Dart to JavaScript compiler designed to create idiomatic,
55
readable JavaScript output.

pkg/dev_compiler/test/checker/checker_test.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2692,11 +2692,16 @@ void main() {
26922692
Future<int> z;
26932693
26942694
void baz() async {
2695-
int a = /*info:DynamicCast*/await /*info:DynamicCast*/x;
2696-
int b = await /*severe:StaticTypeError*/y;
2695+
int a = /*info:DynamicCast*/await x;
2696+
int b = await y;
26972697
int c = await z;
26982698
String d = /*severe:StaticTypeError*/await z;
26992699
}
2700+
2701+
Future<bool> get issue_264 async {
2702+
await 42;
2703+
return false;
2704+
}
27002705
'''
27012706
}));
27022707

0 commit comments

Comments
 (0)