diff --git a/frontends/p4/specializeGenericTypes.cpp b/frontends/p4/specializeGenericTypes.cpp index b6c64ab06c..d1ab5a8d36 100644 --- a/frontends/p4/specializeGenericTypes.cpp +++ b/frontends/p4/specializeGenericTypes.cpp @@ -167,6 +167,9 @@ const IR::Node *ReplaceTypeUses::postorder(IR::Type_Specialized *type) { } const IR::Node *ReplaceTypeUses::postorder(IR::StructExpression *expression) { + const IR::Annotation *anNode = findContext(); + if (anNode != nullptr && !anNode->structured) return expression; + auto st = getOriginal()->structType; if (!st) { ::P4::error(ErrorType::ERR_TYPE_ERROR,