Repository navigation
with fix-ceremony: a trait impl method's return type that restates the trait's is removed (part of #3061) - #3599
Merged
Merged
Conversation
…e trait's is removed (part of #3061)
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.
Part of #3061 (item 1, the case that needs no policy answer) and part of #2519 (its first example:
impl One for f64: fn one() -> f64: 1.0). Both issues stay open.The proof. The trait declares the return, and an impl method written without one has exactly that return (published before any body is checked; #3598 made the body check the same as under a written one). Sema records the written type node when it resolves to the trait's type, an alias of it included.
Where it does not fire. A method or an owner with type parameters, and an
asyncorgenmethod: the contract return is not published ahead for those, so the written type is left. A free function is untouched: that is the open half of item 1.In the tree.
src/has none.lib/stdhas them, reached with a standard-library file as the entry (--std lib/std/random.with: 24;lib/std/json.with: 11). That sweep is its own PR.Test:
test/internals_compiler/ceremony_fix_test.withgains a sample with a plain type, an alias, aResult, a generic owner and a free function; the rewritten sample compiles and is compared byte for byte.Evidence at 031ea83: both compilers check the source; release build,
:unit-return-review,:ceremony-census,:self-audit,:internals-compiler-testsgreen; battery green.