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

Unified Diff: pkg/front_end/lib/src/fasta/type_inference/type_schema.dart

Issue 2842283002: Add a clarifying comment explaining why UnknownType.accept() doesn't throw. (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/type_inference/type_schema.dart
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_schema.dart b/pkg/front_end/lib/src/fasta/type_inference/type_schema.dart
index f9c7f77b00f66911155db4fa566b74c65911d4ce..5268f62d08a7fe41c855b3e687cfe6c78730b768 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_schema.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_schema.dart
@@ -61,6 +61,11 @@ class UnknownType extends DartType {
if (v is TypeSchemaVisitor) {
return v.visitUnknownType(this);
} else {
+ // Note: in principle it seems like this should throw, since any visitor
+ // that operates on a type schema ought to inherit from TypeSchemaVisitor.
+ // However, that would make it impossible to use toString() on any type
+ // schema, since toString() uses the kernel's Printer visitor, which can't
+ // possibly inherit from TypeSchemaVisitor since it's inside kernel.
return v.defaultDartType(this);
}
}
« 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