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

spv/lower: set FuncParam attrs to those attached to OpFunctionParameter. #12

Merged
merged 1 commit into from
Dec 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/spv/lower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ impl Module {
}
}

let mut params = vec![];
let mut params = SmallVec::<[_; 8]>::new();

let mut func_def_body = if has_blocks {
match &mut func_decl.def {
Expand Down Expand Up @@ -1471,10 +1471,11 @@ impl Module {
)));
}

for (i, (func_type_param, param)) in
for (i, (func_decl_param, param)) in
func_decl.params.iter_mut().zip(params).enumerate()
{
if func_type_param.ty != param.ty {
func_decl_param.attrs = param.attrs;
if func_decl_param.ty != param.ty {
// FIXME(remove) embed IDs in errors by moving them to the
// `let invalid = |...| ...;` closure that wraps insts.
return Err(invalid(&format!(
Expand All @@ -1486,7 +1487,7 @@ impl Module {
print::Plan::for_root(
&cx,
&print::ExpectedVsFound {
expected: func_type_param.ty,
expected: func_decl_param.ty,
found: param.ty,
}
)
Expand Down