OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 dart2js.typechecker; | 5 part of dart2js; |
6 | |
7 import 'constants/expressions.dart'; | |
8 import 'constants/values.dart'; | |
9 import 'core_types.dart'; | |
10 import 'dart2jslib.dart' show | |
11 Compiler, | |
12 CompilerTask, | |
13 invariant, | |
14 isPrivateName; | |
15 import 'dart_types.dart'; | |
16 import 'elements/elements.dart' show | |
17 AbstractFieldElement, | |
18 AstElement, | |
19 AsyncMarker, | |
20 ClassElement, | |
21 ConstructorElement, | |
22 Element, | |
23 Elements, | |
24 EnumClassElement, | |
25 ExecutableElement, | |
26 FieldElement, | |
27 FunctionElement, | |
28 GetterElement, | |
29 InitializingFormalElement, | |
30 LibraryElement, | |
31 Member, | |
32 MemberSignature, | |
33 Name, | |
34 ParameterElement, | |
35 PrivateName, | |
36 PublicName, | |
37 ResolvedAst, | |
38 SetterElement, | |
39 TypeDeclarationElement, | |
40 TypedElement, | |
41 TypedefElement, | |
42 VariableElement; | |
43 import 'messages.dart'; | |
44 import 'resolution/resolution.dart' show | |
45 TreeElements; | |
46 import 'resolution/class_members.dart' show | |
47 MembersCreator; | |
48 import 'tree/tree.dart'; | |
49 import 'util/util.dart' show | |
50 Link, | |
51 LinkBuilder, | |
52 Spannable; | |
53 import '../compiler_new.dart' as api; | |
54 | 6 |
55 class TypeCheckerTask extends CompilerTask { | 7 class TypeCheckerTask extends CompilerTask { |
56 TypeCheckerTask(Compiler compiler) : super(compiler); | 8 TypeCheckerTask(Compiler compiler) : super(compiler); |
57 String get name => "Type checker"; | 9 String get name => "Type checker"; |
58 | 10 |
59 void check(AstElement element) { | 11 void check(AstElement element) { |
60 if (element.isClass) return; | 12 if (element.isClass) return; |
61 if (element.isTypedef) return; | 13 if (element.isTypedef) return; |
62 ResolvedAst resolvedAst = element.resolvedAst; | 14 ResolvedAst resolvedAst = element.resolvedAst; |
63 compiler.withCurrentElement(element, () { | 15 compiler.withCurrentElement(element, () { |
(...skipping 1856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1920 | 1872 |
1921 visitTypedef(Typedef node) { | 1873 visitTypedef(Typedef node) { |
1922 // Do not typecheck [Typedef] nodes. | 1874 // Do not typecheck [Typedef] nodes. |
1923 } | 1875 } |
1924 | 1876 |
1925 visitNode(Node node) { | 1877 visitNode(Node node) { |
1926 compiler.internalError(node, | 1878 compiler.internalError(node, |
1927 'Unexpected node ${node.getObjectDescription()} in the type checker.'); | 1879 'Unexpected node ${node.getObjectDescription()} in the type checker.'); |
1928 } | 1880 } |
1929 } | 1881 } |
OLD | NEW |