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 indirect impl support for inference. #4420

Merged
merged 1 commit into from
Nov 19, 2023

Conversation

orizi
Copy link
Collaborator

@orizi orizi commented Nov 19, 2023

This change is Reviewable

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 5 of 6 files at r1, all commit messages.
Reviewable status: 5 of 6 files reviewed, 2 unresolved discussions (waiting on @orizi)


crates/cairo-lang-semantic/src/items/impl_alias.rs line 223 at r1 (raw file):

    _impl_alias_id: &ImplAliasId,
) -> Maybe<ImplDefId> {
    Err(skip_diagnostic())

Explain why it's ok.


tests/bug_samples/lib.cairo line 2 at r1 (raw file):

mod ecdsa_completeness;
mod indirect_impl;

Suggestion:

indirect_impl_alias;

@orizi orizi force-pushed the orizi/impl-resolve-for-inference branch from 9951f4f to d9110d9 Compare November 19, 2023 15:46
Included small refactor + removal of unneed extra module lookup.
@orizi orizi force-pushed the orizi/impl-resolve-for-inference branch from d9110d9 to 032b7fb Compare November 19, 2023 15:55
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: 4 of 6 files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware)


crates/cairo-lang-semantic/src/items/impl_alias.rs line 223 at r1 (raw file):

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

Explain why it's ok.

Done.

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.

:lgtm:

Reviewed 1 of 6 files at r1, 4 of 4 files at r2.
Reviewable status: all files reviewed (commit messages unreviewed), 1 unresolved discussion (waiting on @orizi)


crates/cairo-lang-semantic/src/items/imp.rs line 926 at r2 (raw file):

        res.insert(UninferredImpl::GenericParam(*generic_param_id));
    }
    for module_id in chain!(lookup_context.modules.iter().map(|x| &x.0)) {

Shouldn't it be in another pr?
And I guess the prelude module is added to the context somewhere else?

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 all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @orizi)

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: all files reviewed, 1 unresolved discussion (waiting on @gilbens-starkware)


crates/cairo-lang-semantic/src/items/imp.rs line 926 at r2 (raw file):

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

Shouldn't it be in another pr?
And I guess the prelude module is added to the context somewhere else?

it isn't - but in the corelib all impls are either next to the trait or next to the type.

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: :shipit: complete! all files reviewed, all discussions resolved (waiting on @orizi)


crates/cairo-lang-semantic/src/items/imp.rs line 926 at r2 (raw file):

Previously, orizi wrote…

it isn't - but in the corelib all impls are either next to the trait or next to the type.

Makes sense.

@orizi orizi added this pull request to the merge queue Nov 19, 2023
Merged via the queue into dev-v2.4.0 with commit 8af8df3 Nov 19, 2023
38 checks passed
@orizi orizi deleted the orizi/impl-resolve-for-inference branch November 19, 2023 16:38
@orizi orizi linked an issue Nov 19, 2023 that may be closed by this pull request
orizi added a commit that referenced this pull request Nov 19, 2023
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: Trait has no implementation in context when using named impls
2 participants