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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/verifier.dart

Issue 2843333005: Extend pkg/front_end/lib/src/fasta/kernel/verifier.dart to check for UnknownType. (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/front_end/front_end.iml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/kernel/verifier.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/verifier.dart b/pkg/front_end/lib/src/fasta/kernel/verifier.dart
index 57114240103d75efc51f2b8cca5dfb1fce79f612..291656ef6afc7ed0a12a2b29a75e0b5dcc24d268 100644
--- a/pkg/front_end/lib/src/fasta/kernel/verifier.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/verifier.dart
@@ -4,6 +4,9 @@
library fasta.verifier;
+import 'package:front_end/src/fasta/type_inference/type_schema.dart'
+ show TypeSchemaVisitor, UnknownType;
+
import 'package:kernel/ast.dart'
show
InvalidExpression,
@@ -30,7 +33,8 @@ List<VerificationError> verifyProgram(Program program,
return verifier.errors;
}
-class FastaVerifyingVisitor extends VerifyingVisitor {
+class FastaVerifyingVisitor extends VerifyingVisitor
+ implements TypeSchemaVisitor {
final List<VerificationError> errors = <VerificationError>[];
String fileUri;
@@ -42,7 +46,7 @@ class FastaVerifyingVisitor extends VerifyingVisitor {
@override
problem(TreeNode node, String details) {
VerificationError error = new VerificationError(context, node, details);
- printUnexpected(Uri.parse(fileUri), node.fileOffset, "$error");
+ printUnexpected(Uri.parse(fileUri), node?.fileOffset ?? 0, "$error");
ahe 2017/04/27 16:38:20 -1.
Paul Berry 2017/04/27 16:43:51 Done.
errors.add(error);
}
@@ -93,4 +97,10 @@ class FastaVerifyingVisitor extends VerifyingVisitor {
visitInvalidInitializer(InvalidInitializer node) {
problem(node, "Invalid initializer.");
}
+
+ @override
+ visitUnknownType(UnknownType node) {
+ // Note: we can't pass [node] to [problem] because it's not a [TreeNode].
+ problem(null, "Unexpected appearance of the unknown type.");
+ }
}
« no previous file with comments | « pkg/front_end/front_end.iml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698