Parent PRD
#140
What to build
Define the Type sum type and the boundary helpers needed to migrate string-typed slots one at a time. No call sites change yet.
enum Type {
Builtin(BuiltinType) # int, bool, str, char, ptr, cstr, void, ...
Generic(str, List[Type]) # base name + parameter types
Function(List[Type], List[Type]) # parameters, returns
TypeVar(str) # generic type parameter
}
Add parse_type str -> Type (must accept everything the current string-based code stores) and Type.format -> str (must produce strings the existing parser/printer accepts). Cover nested generics, function types, type variables. See parent PRD's "Proposed solution".
Acceptance criteria
Blocked by
None - can start immediately.
User stories addressed
Foundation for all of #140. Migration step 1 in parent PRD.
Parent PRD
#140
What to build
Define the
Typesum type and the boundary helpers needed to migrate string-typed slots one at a time. No call sites change yet.Add
parse_type str -> Type(must accept everything the current string-based code stores) andType.format -> str(must produce strings the existing parser/printer accepts). Cover nested generics, function types, type variables. See parent PRD's "Proposed solution".Acceptance criteria
Typeenum defined incompiler/common.casawith the four variants aboveparse_typeandType.formatimplementedtests/test_compiler.sh(or compiler unit tests) covering: builtins, nested generics (List[Map[str int]]), function types, type variablestests/test_examples.shandtests/test_compiler.shpassBlocked by
None - can start immediately.
User stories addressed
Foundation for all of #140. Migration step 1 in parent PRD.