diff --git a/tests/irdl/test_declarative_assembly_format.py b/tests/irdl/test_declarative_assembly_format.py index 82245d3c29..ad088f7cbc 100644 --- a/tests/irdl/test_declarative_assembly_format.py +++ b/tests/irdl/test_declarative_assembly_format.py @@ -2364,8 +2364,9 @@ class ParamOne(ParametrizedAttribute, TypeAttribute, Generic[_T]): p: ParameterDef[_T] q: ParameterDef[Attribute] - @staticmethod + @classmethod def constr( + cls, *, n: GenericAttrConstraint[Attribute] | None = None, p: GenericAttrConstraint[_ConstrT] | None = None, @@ -2409,8 +2410,9 @@ class ParamOne(ParametrizedAttribute, TypeAttribute, Generic[_T]): name = "test.param_one" p: ParameterDef[_T] - @staticmethod + @classmethod def constr( + cls, *, p: GenericAttrConstraint[_ConstrT] | None = None, ) -> BaseAttr[ParamOne[Attribute]] | ParamAttrConstraint[ParamOne[_ConstrT]]: diff --git a/xdsl/dialects/builtin.py b/xdsl/dialects/builtin.py index f5bee761e7..c20ad90b40 100644 --- a/xdsl/dialects/builtin.py +++ b/xdsl/dialects/builtin.py @@ -739,8 +739,9 @@ def print_without_type(self, printer: Printer): def get_type(self) -> Attribute: return self.type - @staticmethod + @classmethod def constr( + cls, *, value: AttrConstraint | None = None, type: GenericAttrConstraint[_IntegerAttrTypeConstrT] = IntegerAttrTypeConstr, @@ -1952,8 +1953,9 @@ def get_strides(self) -> Sequence[int | None] | None: case _: return self.layout.get_strides() - @staticmethod + @classmethod def constr( + cls, *, shape: GenericAttrConstraint[Attribute] | None = None, element_type: GenericAttrConstraint[_MemRefTypeElementConstrT] = AnyAttr(),