Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: make TypedAttribute not generic #3505

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/irdl/test_attribute_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def test_typed_attribute():

@irdl_attr_definition
class TypedAttr( # pyright: ignore[reportUnusedClass]
TypedAttribute[Attribute]
TypedAttribute
):
name = "test.typed"

Expand Down
6 changes: 3 additions & 3 deletions xdsl/dialects/builtin.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ class IndexType(ParametrizedAttribute):
@irdl_attr_definition
class IntegerAttr(
Generic[_IntegerAttrType],
TypedAttribute[_IntegerAttrType],
TypedAttribute,
):
name = "integer"
value: ParameterDef[IntAttr]
Expand Down Expand Up @@ -504,8 +504,8 @@ def verify(self) -> None:
@staticmethod
def parse_with_type(
parser: AttrParser,
type: AttributeInvT,
) -> TypedAttribute[AttributeInvT]:
type: Attribute,
) -> TypedAttribute:
assert isinstance(type, IntegerType | IndexType)
return IntegerAttr(parser.parse_integer(allow_boolean=(type == i1)), type)

Expand Down
6 changes: 3 additions & 3 deletions xdsl/ir/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ def _verify(self):
super()._verify()


class TypedAttribute(ParametrizedAttribute, Generic[AttributeCovT], ABC):
class TypedAttribute(ParametrizedAttribute, ABC):
"""
An attribute with a type.
"""
Expand All @@ -617,8 +617,8 @@ def get_type_index(cls) -> int: ...
@staticmethod
def parse_with_type(
parser: AttrParser,
type: AttributeInvT,
) -> TypedAttribute[AttributeInvT]:
type: Attribute,
) -> TypedAttribute:
"""
Parse the attribute with the given type.
"""
Expand Down
Loading