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

added closure params to semantic defs in lowering #7085

Merged
merged 1 commit into from
Jan 16, 2025

Conversation

TomerStarkware
Copy link
Collaborator

No description provided.

@TomerStarkware TomerStarkware self-assigned this Jan 15, 2025
@reviewable-StarkWare
Copy link

This change is Reviewable

@TomerStarkware TomerStarkware requested a review from orizi January 15, 2025 11:24
Copy link
Collaborator

@orizi orizi left a 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);
}

Copy link
Collaborator

@orizi orizi left a 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);

@orizi orizi linked an issue Jan 15, 2025 that may be closed by this pull request
@TomerStarkware TomerStarkware force-pushed the tomer/fix_closure_semantic_defs_in_lowering branch from afce27b to cdd718b Compare January 16, 2025 10:06
Copy link
Collaborator Author

@TomerStarkware TomerStarkware left a 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.

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @TomerStarkware)

@TomerStarkware TomerStarkware added this pull request to the merge queue Jan 16, 2025
Merged via the queue into main with commit 65e47a0 Jan 16, 2025
48 checks passed
dean-starkware pushed a commit that referenced this pull request Jan 16, 2025
…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)
dean-starkware pushed a commit that referenced this pull request Jan 16, 2025
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)
dean-starkware pushed a commit that referenced this pull request Jan 16, 2025
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)
@orizi orizi deleted the tomer/fix_closure_semantic_defs_in_lowering branch January 19, 2025 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: lowering block_builder "no entry found for key" in closure
3 participants