Skip to content

Commit

Permalink
allow await to be any value, fixes part of #264
Browse files Browse the repository at this point in the history
  • Loading branch information
John Messerly committed Jul 22, 2015
1 parent 2652875 commit bbf2920
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
6 changes: 0 additions & 6 deletions pkg/dev_compiler/lib/src/checker/checker.dart
Original file line number Diff line number Diff line change
Expand Up @@ -669,12 +669,6 @@ class CodeChecker extends RecursiveAstVisitor {
node.visitChildren(this);
}

@override
void visitAwaitExpression(AwaitExpression node) {
checkAssignment(node.expression, rules.provider.futureDynamicType);
node.visitChildren(this);
}

@override
void visitPropertyAccess(PropertyAccess node) {
var target = node.realTarget;
Expand Down
2 changes: 1 addition & 1 deletion pkg/dev_compiler/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: dev_compiler
version: 0.1.2
version: 0.1.3
description: >
Experimental Dart to JavaScript compiler designed to create idiomatic,
readable JavaScript output.
Expand Down
9 changes: 7 additions & 2 deletions pkg/dev_compiler/test/checker/checker_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2692,11 +2692,16 @@ void main() {
Future<int> z;
void baz() async {
int a = /*info:DynamicCast*/await /*info:DynamicCast*/x;
int b = await /*severe:StaticTypeError*/y;
int a = /*info:DynamicCast*/await x;
int b = await y;
int c = await z;
String d = /*severe:StaticTypeError*/await z;
}
Future<bool> get issue_264 async {
await 42;
return false;
}
'''
}));

Expand Down

0 comments on commit bbf2920

Please sign in to comment.