-
Notifications
You must be signed in to change notification settings - Fork 78
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
Traits in PIL #1450
Conversation
}); | ||
|
||
let s = format!( | ||
"impl{type_vars} {trait_name}{trait_vars} {{\n{methods}}}", |
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.
There is the function format_type_scheme_around_name
that could help here.
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.
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:
Line 355 in e904efd
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?
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 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>
Impl of #1286.