OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library dev_compiler.src.checker.checker; | 5 library dev_compiler.src.checker.checker; |
6 | 6 |
7 import 'package:analyzer/analyzer.dart'; | 7 import 'package:analyzer/analyzer.dart'; |
8 import 'package:analyzer/src/generated/ast.dart'; | 8 import 'package:analyzer/src/generated/ast.dart'; |
9 import 'package:analyzer/src/generated/element.dart'; | 9 import 'package:analyzer/src/generated/element.dart'; |
10 import 'package:analyzer/src/generated/scanner.dart' show Token, TokenType; | 10 import 'package:analyzer/src/generated/scanner.dart' show Token, TokenType; |
(...skipping 653 matching lines...) Loading... |
664 node.visitChildren(this); | 664 node.visitChildren(this); |
665 } | 665 } |
666 | 666 |
667 @override | 667 @override |
668 void visitYieldStatement(YieldStatement node) { | 668 void visitYieldStatement(YieldStatement node) { |
669 _checkReturnOrYield(node.expression, node, node.star != null); | 669 _checkReturnOrYield(node.expression, node, node.star != null); |
670 node.visitChildren(this); | 670 node.visitChildren(this); |
671 } | 671 } |
672 | 672 |
673 @override | 673 @override |
| 674 void visitAwaitExpression(AwaitExpression node) { |
| 675 checkAssignment(node.expression, _rules.provider.futureDynamicType); |
| 676 node.visitChildren(this); |
| 677 } |
| 678 |
| 679 @override |
674 void visitPropertyAccess(PropertyAccess node) { | 680 void visitPropertyAccess(PropertyAccess node) { |
675 var target = node.realTarget; | 681 var target = node.realTarget; |
676 if (_rules.isDynamicTarget(target)) { | 682 if (_rules.isDynamicTarget(target)) { |
677 _recordDynamicInvoke(node, target); | 683 _recordDynamicInvoke(node, target); |
678 } | 684 } |
679 node.visitChildren(this); | 685 node.visitChildren(this); |
680 } | 686 } |
681 | 687 |
682 @override | 688 @override |
683 void visitPrefixedIdentifier(PrefixedIdentifier node) { | 689 void visitPrefixedIdentifier(PrefixedIdentifier node) { |
(...skipping 309 matching lines...) Loading... |
993 void _recordMessage(StaticInfo info) { | 999 void _recordMessage(StaticInfo info) { |
994 if (info == null) return; | 1000 if (info == null) return; |
995 if (info.level >= logger.Level.SEVERE) _failure = true; | 1001 if (info.level >= logger.Level.SEVERE) _failure = true; |
996 _reporter.log(info); | 1002 _reporter.log(info); |
997 if (info is CoercionInfo) { | 1003 if (info is CoercionInfo) { |
998 assert(CoercionInfo.get(info.node) == null); | 1004 assert(CoercionInfo.get(info.node) == null); |
999 CoercionInfo.set(info.node, info); | 1005 CoercionInfo.set(info.node, info); |
1000 } | 1006 } |
1001 } | 1007 } |
1002 } | 1008 } |
OLD | NEW |