Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coroc: don't register type information for functions with type parameters #124

Merged
merged 9 commits into from
Dec 12, 2023

Conversation

chriso
Copy link
Contributor

@chriso chriso commented Dec 12, 2023

This partially fixes #123.

This PR updates the compiler to ignore generic functions when registering type information for the runtime and its serialization layer (via types.RegisterFunc and types.RegisterClosure).

This expands the range of Go programs with generics that are supported. If the input program never serializes a reference to a generic function or a closure created within a generic function, the compiler output is valid. For cases where the input attempts to serialize a generic function or nested closure, a runtime check has been implemented. This check triggers a panic if type information is unavailable for the particular function.

@chriso chriso merged commit 8e8f3bf into main Dec 12, 2023
2 checks passed
@chriso chriso deleted the generics branch December 12, 2023 21:21
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.

Support functions with type parameters
2 participants