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

$typeof(*x) should be valid when x is an [out] parameter #1226

Closed
cbuttner opened this issue Jul 4, 2024 · 2 comments
Closed

$typeof(*x) should be valid when x is an [out] parameter #1226

cbuttner opened this issue Jul 4, 2024 · 2 comments
Assignees
Labels
Bug Something isn't working Fixed Needs Verification Fixed, but needs verification that it works

Comments

@cbuttner
Copy link
Contributor

cbuttner commented Jul 4, 2024

We run into this problem here:

/**
 * @param [out] x "The variable or dereferenced pointer to store to."
 * @param value "The value to store."
 * @param $alignment "The alignment to assume for the store"
 * @return "The value of x"
 *
 * @require $assignable(value, $typeof(*x)) : "The value doesn't match the variable"
                                       ^^
Error: 'out' parameters may not be read.
 * @require @constant_is_power_of_2($alignment) : "The alignment must be a power of two"
 **/
macro @unaligned_store(&x, value, usz $alignment) @builtin
{
	return $$unaligned_store(x, ($typeof(*x))value, $alignment);
}
@lerno
Copy link
Collaborator

lerno commented Jul 4, 2024

Some overeager evaluation there. Please try now.

@lerno lerno self-assigned this Jul 4, 2024
@lerno lerno added Bug Something isn't working Fixed Needs Verification Fixed, but needs verification that it works labels Jul 4, 2024
@cbuttner
Copy link
Contributor Author

cbuttner commented Jul 5, 2024

👍

@cbuttner cbuttner closed this as completed Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Fixed Needs Verification Fixed, but needs verification that it works
Projects
None yet
Development

No branches or pull requests

2 participants