Require a box receiver for ssl/crypto's apply methods - #99
Merged
Conversation
Member
Author
|
Autonomous-mode decision log — PR-specific No design decision here; the breaking change follows the issue's fix direction |
`fun tag` on a primitive weakens the receiver to one that cannot read fields, on a type that has none. It bought nothing and cost the `HashFn` interface its implementers: a `box` method is not a subtype of a `tag` method, so every implementer had to declare `apply` `tag` as well. The interface has to lose `tag` before its implementers can, so all thirteen declarations change together. Closes #94
SeanTAllen
force-pushed
the
plain-fun-on-crypto-primitives
branch
from
July 10, 2026 17:18
f503393 to
4e4df67
Compare
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.
Every
applyonssl/crypto's hash and one-shot primitives, and theHashFninterface, was declaredfun tag. On a fieldless primitivetagandboxcompile to the same code, buttagforced aHashFnimplementer to declareapplytagas well, because aboxmethod is not a subtype of atagone. Droppingtagwidens what satisfies the interface and only breaks calling through aHashFn tagreference.The interface has to lose
tagbefore its implementers can, so all thirteen declarations change together.Closes #94