Skip to content

Commit 3983c36

Browse files
committed
Swift: avoid inheriting annotations
1 parent a67341c commit 3983c36

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

swift/codegen/lib/schema/schema.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,12 @@ def _get_class(cls: type) -> Class:
174174
derived={d.__name__ for d in cls.__subclasses__()},
175175
# getattr to inherit from bases
176176
group=getattr(cls, "group", ""),
177-
# not getattr not to inherit from bases
177+
# in the following we don't use `getattr` to avoid inheriting
178178
pragmas=cls.__dict__.get("pragmas", []),
179-
# not getattr not to inherit from bases
180179
ipa=cls.__dict__.get("ipa", None),
181180
properties=[
182181
a | _PropertyNamer(n)
183-
for n, a in cls.__annotations__.items()
182+
for n, a in cls.__dict__.get("__annotations__", {}).items()
184183
],
185184
)
186185

0 commit comments

Comments
 (0)