| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library kernel.type_checker; | 4 library kernel.type_checker; |
| 5 | 5 |
| 6 import 'ast.dart'; | 6 import 'ast.dart'; |
| 7 import 'class_hierarchy.dart'; | 7 import 'class_hierarchy.dart'; |
| 8 import 'core_types.dart'; | 8 import 'core_types.dart'; |
| 9 import 'type_algebra.dart'; | 9 import 'type_algebra.dart'; |
| 10 import 'type_environment.dart'; | 10 import 'type_environment.dart'; |
| (...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 } | 673 } |
| 674 | 674 |
| 675 @override | 675 @override |
| 676 DartType visitVariableSet(VariableSet node) { | 676 DartType visitVariableSet(VariableSet node) { |
| 677 var value = visitExpression(node.value); | 677 var value = visitExpression(node.value); |
| 678 checkAssignable(node.value, value, node.variable.type); | 678 checkAssignable(node.value, value, node.variable.type); |
| 679 return value; | 679 return value; |
| 680 } | 680 } |
| 681 | 681 |
| 682 @override | 682 @override |
| 683 DartType visitLoadLibrary(LoadLibrary node) { |
| 684 return environment.futureType(const DynamicType()); |
| 685 } |
| 686 |
| 687 @override |
| 688 DartType visitCheckLibraryIsLoaded(CheckLibraryIsLoaded node) { |
| 689 return environment.objectType; |
| 690 } |
| 691 |
| 692 @override |
| 683 visitAssertStatement(AssertStatement node) { | 693 visitAssertStatement(AssertStatement node) { |
| 684 visitExpression(node.condition); | 694 visitExpression(node.condition); |
| 685 if (node.message != null) { | 695 if (node.message != null) { |
| 686 visitExpression(node.message); | 696 visitExpression(node.message); |
| 687 } | 697 } |
| 688 } | 698 } |
| 689 | 699 |
| 690 @override | 700 @override |
| 691 visitBlock(Block node) { | 701 visitBlock(Block node) { |
| 692 node.statements.forEach(visitStatement); | 702 node.statements.forEach(visitStatement); |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 892 } | 902 } |
| 893 | 903 |
| 894 @override | 904 @override |
| 895 visitLocalInitializer(LocalInitializer node) { | 905 visitLocalInitializer(LocalInitializer node) { |
| 896 visitVariableDeclaration(node.variable); | 906 visitVariableDeclaration(node.variable); |
| 897 } | 907 } |
| 898 | 908 |
| 899 @override | 909 @override |
| 900 visitInvalidInitializer(InvalidInitializer node) {} | 910 visitInvalidInitializer(InvalidInitializer node) {} |
| 901 } | 911 } |
| OLD | NEW |