Skip to content

Commit

Permalink
Merge pull request #53 from xdslproject/type_annotation_changes
Browse files Browse the repository at this point in the history
  • Loading branch information
michel-steuwer authored Feb 23, 2022
2 parents 02e3e3c + 7749e7a commit c06d548
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/xdsl/irdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class OptResultDef(VarResultDef, OptionalDef):


@dataclass
class RegionDef:
class RegionDef(Region):
"""
An IRDL region definition.
If the block_args is specified, then the region expect to have the entry block with these arguments.
Expand Down Expand Up @@ -531,11 +531,7 @@ def irdl_op_builder(cls: typing.Type[OpT], operands: List,
regions=regions)


OperationType = TypeVar("OperationType", bound=Operation)


def irdl_op_definition(
cls: typing.Type[OperationType]) -> typing.Type[OperationType]:
def irdl_op_definition(cls: typing.Type[Operation]) -> typing.Type[_]:
"""Decorator used on classes to define a new operation definition."""

assert issubclass(
Expand Down Expand Up @@ -631,7 +627,7 @@ def builder(cls,

new_attrs["build"] = classmethod(builder)

return type(cls.__name__, (cls, ), {**cls.__dict__, **new_attrs})
return type(cls.__name__, cls.__mro__, {**cls.__dict__, **new_attrs})


@dataclass
Expand Down

0 comments on commit c06d548

Please sign in to comment.