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

Delayed numeric literal resolution allowing catch all integer Drop Copy. #7161

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

orizi
Copy link
Collaborator

@orizi orizi commented Jan 26, 2025

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

@orizi orizi linked an issue Jan 26, 2025 that may be closed by this pull request
@orizi orizi force-pushed the orizi/delay-numeric-literal-resolve branch 2 times, most recently from 6d915ab to b3a172f Compare January 26, 2025 15:47
Copy link
Contributor

@gilbens-starkware gilbens-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 15 files at r1, all commit messages.
Reviewable status: 2 of 15 files reviewed, 2 unresolved discussions (waiting on @orizi and @TomerStarkware)


tests/bug_samples/issue7155.cairo line 3 at r1 (raw file):

#[test]
fn test_enumerate_type_resolution() {
    for (k, v) in array![0, 1, 2_usize].into_iter().enumerate() {

Suggestion:

or (k, v) in array![0, 1, 2]

crates/cairo-lang-plugins/src/test_data/config line 304 at r1 (raw file):

//! > expanded_cairo_code

#[cfg(and(a, b))]

What cause this?

Code quote:

//! > expanded_cairo_code

#[cfg(and(a, b))]

Copy link
Contributor

@gilbens-starkware gilbens-starkware 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: 2 of 15 files reviewed, 3 unresolved discussions (waiting on @orizi and @TomerStarkware)


corelib/src/integer.cairo line 83 at r1 (raw file):

    // Attached traits for all numeric literals.
    impl Copy: Copy<Self::Type>;
    impl Drop: Drop<Self::Type>;

Where are the new impls used?

Code quote:

    impl Copy: Copy<Self::Type>;
    impl Drop: Drop<Self::Type>;

Copy link
Collaborator Author

@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: 2 of 15 files reviewed, 3 unresolved discussions (waiting on @gilbens-starkware and @TomerStarkware)


corelib/src/integer.cairo line 83 at r1 (raw file):

Previously, gilbens-starkware (Gil Ben-Shachar) wrote…

Where are the new impls used?

automatically in everyplace you have a numeric literal.

if you have 1- it will be Copy and Drop even before we realize it is a felt252 specifically.


crates/cairo-lang-plugins/src/test_data/config line 304 at r1 (raw file):

Previously, gilbens-starkware (Gil Ben-Shachar) wrote…

What cause this?

unclear - reverted.


tests/bug_samples/issue7155.cairo line 3 at r1 (raw file):

#[test]
fn test_enumerate_type_resolution() {
    for (k, v) in array![0, 1, 2_usize].into_iter().enumerate() {

good catch - this didn't actually solve this apparently.
feel free to stop checking this for now.

@orizi orizi force-pushed the orizi/delay-numeric-literal-resolve branch from b3a172f to 7888db9 Compare January 27, 2025 07:50
Copy link
Collaborator

@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.

Reviewed 11 of 15 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @gilbens-starkware)

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: Tuple type inference fails with iter.enumerate()
4 participants