Skip to content

[codegen] deduplicate fieldTypeToLlvmPrimitive into type-system.ts#749

Merged
cs01 merged 3 commits intomainfrom
refactor/dedup-fieldtype-primitive
Apr 26, 2026
Merged

[codegen] deduplicate fieldTypeToLlvmPrimitive into type-system.ts#749
cs01 merged 3 commits intomainfrom
refactor/dedup-fieldtype-primitive

Conversation

@cs01
Copy link
Copy Markdown
Owner

@cs01 cs01 commented Apr 26, 2026

Before

fieldTypeToLlvmPrimitive() was duplicated identically in control-flow.ts and class.ts — same 5-line function mapping string/number/boolean/string-literal to their LLVM types.

After

No user-facing change. Internal refactor only. Single shared fieldTypeToLlvmPrimitive() exported from type-system.ts, imported by both callers.

Description

Part of #710 (eliminate silent-default dispatch). This extracts the primitive type mapping as a shared utility, reducing duplication and making it easier to add new primitive types in one place. Net -6 lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant