diff --git a/cinderx/PythonLib/cinderx/compiler/static/types.py b/cinderx/PythonLib/cinderx/compiler/static/types.py index d7fc7c17f..260e75616 100644 --- a/cinderx/PythonLib/cinderx/compiler/static/types.py +++ b/cinderx/PythonLib/cinderx/compiler/static/types.py @@ -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( @@ -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