encoding: with Encode by value (ENCODING slice 7) #712
Labels
No labels
loop
queue/failed
queue/queued
ready
status/parked
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
torbscript/language#712
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
docs/design/ENCODING.md, section 14, the table of slices: "7with Encode by value| open -bydelegation is built natively, but not for a member with avarparameter, whichencodeis (point 4 of 'What the checker and the back end must support')". Point 4 of that list: "Delegation of a method that takes avarparameter must forward the path and not a copy." The introduction (line 5) also names slice 7 as open. No issue tracks it.Source
by valuewrapper the record uses for well-known types (Instant,Email, around lines 348, 570 and 696).Goal
A single-field type writes
with Encode by value(andDescribe by value) and encodes as its one value, with the type's name kept for the formats that map it.Acceptance criteria
bydelegation forwards avarparameter as the path, not a copy, in the VM and the native back end; a conformance program shows a write through the delegated member reaching the caller's valuetype Email with Encode by valuefrom ENCODING.md type checks and encodes throughstd/jsonas the bare stringDecode by valuebehaves as the record says (line 712) and a type with an invariant is told to writedecodeDependencies
None known.
Seed
Refine decides; likely no, unless the standard library or the compiler's own source adopts
by valuein the same round (then two commits with the seed between).Size
One PR, one or two Conventional Commits (
feat(checker)/feat(backend),test).[loop:torbscript] re-sweep: filed as homeless work: ENCODING.md section 14 marks slice 7 open and no issue tracked it. Label
loop, noready: refine checks the current delegation code against point 4 and confirms the seed statement.