Repository navigation
compiler: the references decoy builds on its own; a type no protocol reaches has to be bounded - #18
Merged
Merged
Conversation
…tocol reaches has to be bounded The resolved-* cases' decoy Invoice (archive) held a string without a maximum and nothing marked it, so archive was refused on its own, whatever api wrote. The decoy now has a marked protocol Dump reaching it, as in bounded/other-schema-marked, and each case expects Dump's given-up bounded_size and acknowledgement. resolved-decoy still fails with bounds::unbounded. New bounded cases: unreached-unmarked, unreached-list-unmarked, unreached-allowed-still-unmarked, unreached-bounded.
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.
Follow-up to #17. core#297 implements the
referencescases and 32 of 37 pass; the fiveresolved-*cases fail because of the fixture, not the rule.The problem
The decoy
archiveschema (struct Invoice { data: string }) was refused on its own: the language requires a position no protocol reaches to be bounded (core#98; docsguides/idl/types.md: "A position no protocol reaches ... has to be bounded"). Soarchivegavebounds::unboundedwhateverapiwrote. The spec had no case for that rule, which is how the fixture slipped through.The decoy now
Still
struct Invoice { data: string }, inarchive, now with a marked protocol that reaches it, as inbounded/other-schema-markedand core#297's own test:The
resolved-*packages setsettings = { annotations = { unverified = { allowed = true } } }and expectDump(gives upbounded_size, acknowledged atprotocolscope with that reason) andOrders(gives up nothing), with the warningunverified::bounded-size. A spelling that wrongly reaches the decoy from the unmarkedOrdersis stillbounds::unbounded, which is whatresolved-decoyexpects (unchanged outcome).The language has no other way for a type nothing reaches: a protocol marker only covers what the protocol reaches. (core also has markers at inner scopes; the spec's cases for them are still to come, so the decoy doesn't use them.)
New
boundedcasesunreached-unmarked: a struct no protocol reaches, with astringwithout a maximum, isbounds::unbounded.unreached-list-unmarked: the same with a list (u8[]).unreached-allowed-still-unmarked: the same where the package allows@unverified; nothing marked it.unreached-bounded: a struct no protocol reaches, bounded, builds with no protocols.The marked form for a type no protocol reaches is the marked protocol that reaches it, already covered by
bounded/other-schema-marked.compiler/readme.md'sboundedrow says so.specs/check.sh --checkis clean.