feat(checker): add input function to preamble

This commit is contained in:
2026-06-23 00:22:38 +02:00
parent a50a207385
commit 7c771c4070

View File

@@ -54,6 +54,11 @@ class Preamble(Environment):
returns=self._list_of(map_out), # TODO: replace with Iterable[U] returns=self._list_of(map_out), # TODO: replace with Iterable[U]
type_vars=[map_in, map_out], type_vars=[map_in, map_out],
) )
self._def_function(
name="input",
pos=[Param("prompt", TopType(), required=False)],
returns=self._types.get_type("str"),
)
def _list_of(self, item_type: Type) -> Type: def _list_of(self, item_type: Type) -> Type:
return self._types.apply_generic(self._types.get_type("list"), [item_type]) return self._types.apply_generic(self._types.get_type("list"), [item_type])