Skip to content
Open
Changes from all commits
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
6 changes: 6 additions & 0 deletions mypyc/irbuild/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ def get_mypyc_attrs(
lines: dict[MypycAttr, int] = {}

def set_mypyc_attr(key: str, value: Any, line: int) -> None:
if (
(key == "native_class" and value is False and attrs.get("allow_interpreted_subclasses") is True)
or (key == "allow_interpreted_subclasses" and value is True and attrs.get("native_class") is False)
):
errors.error("'allow_interpreted_subclasses' cannot be True if 'native_class' is False"

if key in MYPYC_ATTRS:
key = cast(MypycAttr, key)
attrs[key] = value
Expand Down
Loading