34        setName(
"ValidateMatchAnnotations");
 
   36    void postorder(
const IR::Annotation *annotation)
 override {
 
   37        if (annotation->name != IR::Annotation::matchAnnotation) 
return;
 
   38        if (!findContext<IR::StructField>()) 
return;
 
   39        if (annotation->expr.size() != 1)
 
   40            ::error(ErrorType::ERR_INVALID, 
"%1%: annotation must have exactly 1 argument",
 
   42        auto e0 = annotation->expr.at(0);
 
   43        auto type = typeMap->getType(e0, 
true);
 
   44        if (type == 
nullptr) 
return;
 
   45        if (!type->is<IR::Type_MatchKind>())
 
   46            ::error(ErrorType::ERR_TYPE_ERROR, 
"%1%: value must be a match_kind", e0);