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

Fixed available generic args for default impls. #7045

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
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
Loading