Parent PRD
#140
What to build
Drop the string-based type helpers and replace each with a method or match expression on Type. All internal slots are Type by now (#162-#165), so these helpers should have no remaining callers that need string input.
Helpers to remove or rewrite:
extract_generic_base typ:str -> Option[str]
extract_generic_inner typ:str -> Option[str]
extract_generic_params typ:str -> Option[List[str]]
is_fn_type typ:str -> bool
extract_fn_signature_str typ:str -> Option[str]
substitute_type_params typ:str subs:Map[str str] -> str
is_builtin_type typ:str -> bool
- typechecker helpers:
is_type_variable, is_enum_type_var, type_has_unresolved, is_primitive_compare_type, resolve_match_type, type_exists_recursive, validate_type_exists
Each becomes a Type match (e.g. extract_generic_base → match t { Generic(name, _) => Some(name) ... }). substitute_type_params becomes a recursive Type walk taking Map[str Type].
Acceptance criteria
Blocked by
User stories addressed
Migration step 3 in parent PRD: drop string-based helpers.
Parent PRD
#140
What to build
Drop the string-based type helpers and replace each with a method or match expression on
Type. All internal slots areTypeby now (#162-#165), so these helpers should have no remaining callers that need string input.Helpers to remove or rewrite:
extract_generic_base typ:str -> Option[str]extract_generic_inner typ:str -> Option[str]extract_generic_params typ:str -> Option[List[str]]is_fn_type typ:str -> boolextract_fn_signature_str typ:str -> Option[str]substitute_type_params typ:str subs:Map[str str] -> stris_builtin_type typ:str -> boolis_type_variable,is_enum_type_var,type_has_unresolved,is_primitive_compare_type,resolve_match_type,type_exists_recursive,validate_type_existsEach becomes a
Typematch (e.g.extract_generic_base→match t { Generic(name, _) => Some(name) ... }).substitute_type_paramsbecomes a recursiveTypewalk takingMap[str Type].Acceptance criteria
Typemethodstyp: strparameter in compiler internals (excludingOp.type_annotation/Op.deferred_return_typeper PRD scope)tests/test_examples.sh+tests/test_compiler.sh(< /dev/null) passsimplifyreview pass before PRBlocked by
User stories addressed
Migration step 3 in parent PRD: drop string-based helpers.