Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(465)

Side by Side Diff: pkg/compiler/lib/src/typechecker.dart

Issue 2113653003: Support enabling type checker. (Closed) Base URL: sso://user/ahe/dart-sdk@super_mixins
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/dart_types.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 library dart2js.typechecker;
6 6
7 import 'common.dart'; 7 import 'common.dart';
8 import 'common/names.dart' show Identifiers; 8 import 'common/names.dart' show Identifiers;
9 import 'common/resolution.dart' show Resolution; 9 import 'common/resolution.dart' show Resolution;
10 import 'common/tasks.dart' show CompilerTask; 10 import 'common/tasks.dart' show CompilerTask;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 VariableElement; 44 VariableElement;
45 import 'resolution/tree_elements.dart' show TreeElements; 45 import 'resolution/tree_elements.dart' show TreeElements;
46 import 'resolution/class_members.dart' show MembersCreator; 46 import 'resolution/class_members.dart' show MembersCreator;
47 import 'tree/tree.dart'; 47 import 'tree/tree.dart';
48 import 'util/util.dart' show Link, LinkBuilder; 48 import 'util/util.dart' show Link, LinkBuilder;
49 49
50 class TypeCheckerTask extends CompilerTask { 50 class TypeCheckerTask extends CompilerTask {
51 TypeCheckerTask(Compiler compiler) : super(compiler); 51 TypeCheckerTask(Compiler compiler) : super(compiler);
52 String get name => "Type checker"; 52 String get name => "Type checker";
53 53
54 bool enabled = false;
55
54 void check(AstElement element) { 56 void check(AstElement element) {
55 return; 57 if (!enabled) return;
56 if (element.isClass) return; 58 if (element.isClass) return;
57 if (element.isTypedef) return; 59 if (element.isTypedef) return;
58 ResolvedAst resolvedAst = element.resolvedAst; 60 ResolvedAst resolvedAst = element.resolvedAst;
59 if (resolvedAst.node == null) {
60 return;
61 new FiskFisk();
62 }
63 reporter.withCurrentElement(element.implementation, () { 61 reporter.withCurrentElement(element.implementation, () {
64 measure(() { 62 measure(() {
65 TypeCheckerVisitor visitor = new TypeCheckerVisitor( 63 TypeCheckerVisitor visitor = new TypeCheckerVisitor(
66 compiler, resolvedAst.elements, compiler.types); 64 compiler, resolvedAst.elements, compiler.types);
67 if (element.isField) { 65 if (element.isField) {
68 visitor.analyzingInitializer = true; 66 visitor.analyzingInitializer = true;
69 } 67 }
70 resolvedAst.node.accept(visitor); 68 resolvedAst.node.accept(visitor);
71 }); 69 });
72 }); 70 });
(...skipping 1950 matching lines...) Expand 10 before | Expand all | Expand 10 after
2023 2021
2024 visitTypedef(Typedef node) { 2022 visitTypedef(Typedef node) {
2025 // Do not typecheck [Typedef] nodes. 2023 // Do not typecheck [Typedef] nodes.
2026 } 2024 }
2027 2025
2028 visitNode(Node node) { 2026 visitNode(Node node) {
2029 reporter.internalError(node, 2027 reporter.internalError(node,
2030 'Unexpected node ${node.getObjectDescription()} in the type checker.'); 2028 'Unexpected node ${node.getObjectDescription()} in the type checker.');
2031 } 2029 }
2032 } 2030 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/dart_types.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698