-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a generic parameter to SSAValue that constrains the type associated with the SSAValue. This is useful whenever a function only accepts SSAValue of a given type. stack-info: PR: #3987, branch: math-fehr/stack/2
- Loading branch information
Showing
4 changed files
with
22 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
from typing import Generic | ||
|
||
import pytest | ||
|
||
from xdsl.ir import Block, Operation, SSAValue | ||
from xdsl.ir import AttributeCovT, Block, Operation, SSAValue | ||
|
||
|
||
class TestSSAValue(SSAValue): | ||
class TestSSAValue(Generic[AttributeCovT], SSAValue[AttributeCovT]): | ||
@property | ||
def owner(self) -> Operation | Block: | ||
pytest.fail("Attempting to get the owner of a `TestSSAValue`") |