Repository navigation
Conversation
…988) Root cause: check_trait_impl_method_signature_contract (src/SemaCheck.w) compared an impl method's return type with the trait's and D140 typed each parameter from the trait's by name or position, but nothing compared the counts: `fn eq2(other: &Self, extra: i32)` under `trait Equal: fn eq2(self: &Self, other: &Self)` was accepted at the impl and refused only at a call. The counts of non-receiver parameters (`self` is D7's on both sides) must agree: "impl method `eq2` takes 2 parameter(s), and trait `Equal` declares 1 (D140)". Test: test/compile_errors/err_988_impl_method_arity.w (the installed compiler checks it clean).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause: check_trait_impl_method_signature_contract (src/SemaCheck.w)
compared an impl method's return type with the trait's and D140 typed each
parameter from the trait's by name or position, but nothing compared the
counts:
fn eq2(other: &Self, extra: i32)undertrait Equal: fn eq2(self: &Self, other: &Self)was accepted at the impland refused only at a call.
The counts of non-receiver parameters (
selfis D7's on both sides) mustagree: "impl method
eq2takes 2 parameter(s), and traitEqualdeclares 1(D140)".
Test: test/compile_errors/err_988_impl_method_arity.w (the installed
compiler checks it clean).
Closes #988