Skip to content

Commit

Permalink
Fixed available generic args for default impls.
Browse files Browse the repository at this point in the history
Fixes #7038

commit-id:c29f1286
  • Loading branch information
orizi committed Jan 11, 2025
1 parent dff35c0 commit b0af8ca
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/cairo-lang-semantic/src/items/trt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1355,7 +1355,7 @@ pub fn priv_trait_function_body_data(
// Compute declaration semantic.
let trait_function_declaration_data =
db.priv_trait_function_declaration_data(trait_function_id)?;
let parent_resolver_data = db.trait_resolver_data(trait_id)?;
let parent_resolver_data = trait_function_declaration_data.resolver_data;
let inference_id = InferenceId::LookupItemDefinition(LookupItemId::TraitItem(
TraitItemId::Function(trait_function_id),
));
Expand Down
8 changes: 8 additions & 0 deletions tests/bug_samples/issue7038.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
trait DefaultTraitImpl {
fn call<T, F, +Drop<F>, impl func: core::ops::FnOnce<F, ()>[Output: T], +Drop<T>>(
f: F,
) {
func::call(f, ());
f();
}
}
1 change: 1 addition & 0 deletions tests/bug_samples/lib.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ mod issue6623;
mod issue6755;
mod issue6920;
mod issue6968;
mod issue7038;
mod loop_break_in_match;
mod loop_only_change;
mod partial_param_local;
Expand Down

0 comments on commit b0af8ca

Please sign in to comment.