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
20 changes: 20 additions & 0 deletions cinderx/PythonLib/cinderx/compiler/static/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -9007,6 +9007,16 @@ def bind_call(

return NO_EFFECT

def make_generic_type(
self,
index: tuple[Class, ...],
) -> Class:
for tp in index:
if isinstance(tp, CType):
raise TypedSyntaxError(
f"Invalid {self.gen_name.qualname} element type: {tp.instance.name}"
)
return super().make_generic_type(index)

class CheckedDictInstance(Object[CheckedDict]):
def bind_subscr(
Expand Down Expand Up @@ -9121,6 +9131,16 @@ def __init__(
ResolvedTypeRef(self),
)

def make_generic_type(
self,
index: tuple[Class, ...],
) -> Class:
for tp in index:
if isinstance(tp, CType):
raise TypedSyntaxError(
f"Invalid {self.gen_name.qualname} element type: {tp.instance.name}"
)
return super().make_generic_type(index)

class CheckedListInstance(Object[CheckedList]):
@property
Expand Down
Loading