Index: pkg/analysis_server/tool/spec/codegen_matchers.dart |
diff --git a/pkg/analysis_server/tool/spec/codegen_matchers.dart b/pkg/analysis_server/tool/spec/codegen_matchers.dart |
index e2e62fb949282959a9896098bef886a5e9e00185..d6de74b86104a8a9205e548fbd6d72e2427d1228 100644 |
--- a/pkg/analysis_server/tool/spec/codegen_matchers.dart |
+++ b/pkg/analysis_server/tool/spec/codegen_matchers.dart |
@@ -187,6 +187,20 @@ class CodegenMatchersVisitor extends HierarchicalApiVisitor with CodeGenerator { |
void visitTypeReference(TypeReference typeReference) { |
write(camelJoin(['is', typeReference.typeName])); |
} |
+ |
+ @override |
+ void visitTypeUnion(TypeUnion typeUnion) { |
+ bool commaNeeded = false; |
+ write('isOneOf(['); |
+ for (TypeDecl choice in typeUnion.choices) { |
+ if (commaNeeded) { |
+ write(', '); |
+ } |
+ visitTypeDecl(choice); |
+ commaNeeded = true; |
+ } |
+ write('])'); |
+ } |
} |
/** |