From 4e0a27e7c5ce8460db8e1c62ee7b29009566b92f Mon Sep 17 00:00:00 2001 From: Robert Morelli Date: Wed, 26 Aug 2026 14:15:29 -0600 Subject: [PATCH] Checked containers reject ctype element --- .../cinderx/compiler/static/types.py | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) 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