diff --git a/crates/cairo-lang-semantic/src/items/trt.rs b/crates/cairo-lang-semantic/src/items/trt.rs index bb99e56d40a..de5b07930c5 100644 --- a/crates/cairo-lang-semantic/src/items/trt.rs +++ b/crates/cairo-lang-semantic/src/items/trt.rs @@ -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), )); diff --git a/tests/bug_samples/issue7038.cairo b/tests/bug_samples/issue7038.cairo new file mode 100644 index 00000000000..2f2f5e54109 --- /dev/null +++ b/tests/bug_samples/issue7038.cairo @@ -0,0 +1,8 @@ +trait DefaultTraitImpl { + fn call, impl func: core::ops::FnOnce[Output: T], +Drop>( + f: F, + ) { + func::call(f, ()); + f(); + } +} diff --git a/tests/bug_samples/lib.cairo b/tests/bug_samples/lib.cairo index 2d6b0c1a301..8f732fb3581 100644 --- a/tests/bug_samples/lib.cairo +++ b/tests/bug_samples/lib.cairo @@ -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;