In control type well-formedness rule: P4 spec states that "The types parser, control, and package cannot be used as types of arguments for methods, parsers, controls, tables, actions. They can be used as types for the arguments passed to constructors." Petr4's implementation doesn't take this into account. We should check this when declaring a method, parser, control, table, or action. p4 spec ref
In control type well-formedness rule: P4 spec states that "The types parser, control, and package cannot be used as types of arguments for methods, parsers, controls, tables, actions. They can be used as types for the arguments passed to constructors." Petr4's implementation doesn't take this into account. We should check this when declaring a method, parser, control, table, or action. p4 spec ref