-
Notifications
You must be signed in to change notification settings - Fork 558
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
added closure params to semantic defs in lowering #7085
added closure params to semantic defs in lowering #7085
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 4 files at r1, all commit messages.
Reviewable status: 3 of 4 files reviewed, 1 unresolved discussion (waiting on @TomerStarkware)
crates/cairo-lang-lowering/src/lower/test_data/closure
line 314 at r1 (raw file):
let f = |a: bool| format!("{a}{a}"); let _ = f(false); }
attempt to simplify to get to the crux.
Code quote:
fn foo(a: u32) {
let f = |a: bool| format!("{a}{a}");
let _ = f(false);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 3 of 4 files reviewed, 2 unresolved discussions (waiting on @TomerStarkware)
crates/cairo-lang-lowering/src/lower/test_data/closure
line 313 at r1 (raw file):
fn foo(a: u32) { let f = |a: bool| format!("{a}{a}"); let _ = f(false);
Suggestion:
fn foo(a: u32) {
let f = |a: u8| {
*match Option::Some(@a) {
Option::Some(_) => {
match Option::Some(@a) {
Option::Some(x) => Option::Some(x),
Option::None => Option::None,
}
},
Option::None => Option::None,
}.unwrap()
};
let _ = f(2);
afce27b
to
cdd718b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 3 of 4 files reviewed, 2 unresolved discussions (waiting on @orizi and @TomerStarkware)
crates/cairo-lang-lowering/src/lower/test_data/closure
line 314 at r1 (raw file):
Previously, orizi wrote…
attempt to simplify to get to the crux.
Done.
crates/cairo-lang-lowering/src/lower/test_data/closure
line 313 at r1 (raw file):
fn foo(a: u32) { let f = |a: bool| format!("{a}{a}"); let _ = f(false);
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @TomerStarkware)
…7087) chore: orthographic correction in file if_else (#7088) prevents closure parameters from being declared as refrences (#7078) Refactored bounded_int_trim. (#7062) Added const for starknet types. (#6961) feat(corelib): Iterator::fold (#7084) feat(corelib): Iterator::advance_by (#7059) fix(corelib): Add the #[test] annotation to enumerate test (#7098) feat(corelib): storage vectors iterators (#6941) Extract ModuleHelper from const folding. (#7099) Added support for basic `Into`s in consts. (#7100) Removed taking value for `validate_literal`. (#7101) added closure params to semantic defs in lowering (#7085) Added support for `downcast` in constant context. (#7102) fix(corelib): Add the #[test] annotation to enumerate test (#7098)
feat(corelib): Iterator::enumerate (#7048) fix: Fix handling of --skip-first argument Update release_crates.sh (#7087) chore: orthographic correction in file if_else (#7088) prevents closure parameters from being declared as refrences (#7078) Refactored bounded_int_trim. (#7062) Added const for starknet types. (#6961) feat(corelib): Iterator::fold (#7084) feat(corelib): Iterator::advance_by (#7059) fix(corelib): Add the #[test] annotation to enumerate test (#7098) feat(corelib): storage vectors iterators (#6941) Extract ModuleHelper from const folding. (#7099) Added support for basic `Into`s in consts. (#7100) Removed taking value for `validate_literal`. (#7101) added closure params to semantic defs in lowering (#7085) Added support for `downcast` in constant context. (#7102) fix(corelib): Add the #[test] annotation to enumerate test (#7098)
feat(corelib): Iterator::enumerate (#7048) fix: Fix handling of --skip-first argument Update release_crates.sh (#7087) chore: orthographic correction in file if_else (#7088) prevents closure parameters from being declared as refrences (#7078) Refactored bounded_int_trim. (#7062) Added const for starknet types. (#6961) feat(corelib): Iterator::fold (#7084) feat(corelib): Iterator::advance_by (#7059) fix(corelib): Add the #[test] annotation to enumerate test (#7098) feat(corelib): storage vectors iterators (#6941) Extract ModuleHelper from const folding. (#7099) Added support for basic `Into`s in consts. (#7100) Removed taking value for `validate_literal`. (#7101) added closure params to semantic defs in lowering (#7085) Added support for `downcast` in constant context. (#7102) fix(corelib): Add the #[test] annotation to enumerate test (#7098)
No description provided.