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

Traits in PIL #1450

Closed
wants to merge 46 commits into from
Closed

Traits in PIL #1450

wants to merge 46 commits into from

Conversation

gzanitti
Copy link
Collaborator

Impl of #1286.

ast/src/parsed/display.rs Outdated Show resolved Hide resolved
ast/src/parsed/mod.rs Outdated Show resolved Hide resolved
ast/src/parsed/mod.rs Outdated Show resolved Hide resolved
ast/src/parsed/mod.rs Outdated Show resolved Hide resolved
ast/src/parsed/mod.rs Outdated Show resolved Hide resolved
parser/src/powdr.lalrpop Outdated Show resolved Hide resolved
parser/src/powdr.lalrpop Outdated Show resolved Hide resolved
});

let s = format!(
"impl{type_vars} {trait_name}{trait_vars} {{\n{methods}}}",
Copy link
Member

Choose a reason for hiding this comment

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

There is the function format_type_scheme_around_name that could help here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think it will work, because trait_vars is a vector (and type_scheme has only one element).

This difference is the result of this separation between TypeScheme and TraitScheme:

pub struct TraitScheme<E = u64> {

Both could be unified if I model the current TypeScheme with a single element vector (ty), but I felt it would add a lot of code changes. What do you think?

@gzanitti gzanitti marked this pull request as ready for review June 28, 2024 01:08
@gzanitti gzanitti changed the title [WIP] Traits in PIL Traits in PIL Jun 28, 2024
@chriseth
Copy link
Member

I see that you are starting to work on the type checking part. I think this PR is already too big to be properly reviewed at the current stage. Could you maybe split out just the parsing of the trait declarations (not even the impls), so that we can get that merged already?

This was referenced Jun 28, 2024
github-merge-queue bot pushed a commit that referenced this pull request Jul 9, 2024
This PR splits from the main Trait implementation PR #1450 to simplify
the review process.

It includes only the parsing of the traits (not impls) and some
functionality necessary for the code to compile.

---------

Co-authored-by: chriseth <chris@ethereum.org>
@gzanitti gzanitti marked this pull request as draft July 9, 2024 19:22
github-merge-queue bot pushed a commit that referenced this pull request Jul 30, 2024
This PR splits from the main Trait implementation PR
#1450 to simplify the review
process.

It includes only the parsing of the impls (trait parsing PR here: #1489
) and some functionality necessary for the code to compile.

---------

Co-authored-by: chriseth <chris@ethereum.org>
@gzanitti gzanitti closed this Aug 26, 2024
@gzanitti gzanitti deleted the traits_in_pil branch August 26, 2024 21:27
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.

2 participants