Skip to content

transpile: Ensure that there are always types for primitive type kinds#1865

Open
Rua wants to merge 1 commit into
immunant:masterfrom
Rua:primitive-type-kinds
Open

transpile: Ensure that there are always types for primitive type kinds#1865
Rua wants to merge 1 commit into
immunant:masterfrom
Rua:primitive-type-kinds

Conversation

@Rua

@Rua Rua commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

This allows code elsewhere to rely on these kinds always existing, for calling type_for_kind and the like. This can be expanded to include more types in the future if needed.

self.visit_node(untyped_context, node_id, new_id, expected_ty)
}

// Check what primitive kinds were emitted by the compiler.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this could be moved up just before PULLBACK_KINDS, for consistency with the order from mod.rs (and IMHO handling the primitives first then the pullbacks makes sense).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It can't be, because it relies on c_types being filled by the main node processing code right above it first. If it's moved, then c_types will still be empty. The idea here was to add these types only if the compiler didn't already provide them.

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.

2 participants