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

When a builtin function expects type T also allow an adapter for T. #4643

Merged

Conversation

zygoloid
Copy link
Contributor

@zygoloid zygoloid commented Dec 5, 2024

Extends the set of function signatures that support being given a builtin definition to include cases where a parameter or return type is an adapter for a supported type. For example, if we can give a builtin definition to Add(a: i32, b: i32) -> i32, then we can also give a builtin definition to Add(a: MyI32, b: MyI32) - >MyI32 where MyI32 adapts i32.

This is a prerequisite for changing Core.Int to be a class type that adapts the builtin int type.

Specifically, this allows builtin functions to be used with adapters
without needing to perform an extra no-op conversion.
@github-actions github-actions bot requested a review from josh11b December 5, 2024 22:18
Copy link
Contributor

@josh11b josh11b left a comment

Choose a reason for hiding this comment

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

Can you change the title or description that this is talking about using a different signature for a function with a builtin definition rather than there being an implicit conversion of adapter types when calling the function?

@zygoloid zygoloid added this pull request to the merge queue Dec 6, 2024
Merged via the queue into carbon-language:trunk with commit cd1ecf1 Dec 6, 2024
8 checks passed
@zygoloid zygoloid deleted the toolchain-adapter-in-builtin branch December 6, 2024 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants