Exports the decompile result type by name - #159
Merged
Merged
Conversation
decompile's result was a module-local alias, so a host could only derive it from the function, while every other entry point's result has a name. It is now exported from the main entry as DecompileResult, beside ParseResult and CompileResult, and pinned in the export surface list; the shape is unchanged. ADR-0004 gains a foot Note: the accepted amendment on decompile's depth refusal said no name is exported for its result type, and the Note records that this change supersedes that sentence. Refs: pts-shdy
johnnyt
force-pushed
the
pts-shdy-export-decompile-result
branch
from
October 1, 2026 12:46
4bc487e to
6c7ad42
Compare
The entry on ADR-0004 supersedes an accepted sentence and adds a public name, so it changes what the record decides: it is recast from a Note to an Amendment at proposed, with a Typespecs section quoting DecompileResult and the decompile declaration that names it. No line above the entry is removed. Refs: pts-shdy
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.
What
decompile's result type was a module-local alias, so a host could only derive it from the function, while the other entry points' results have exported names. It is now exported from the main entry asDecompileResult, besideParseResultandCompileResult, and listed intest/export-surface.json. The type itself is unchanged. Exporting it was ruled by the operator, 2026-10-01.src/decompile.ts:DecompileResultgainsexport.src/index.ts: the name joins the type re-export from./decompile.js.test/export-surface.json: one sorted entry.changelog.d/pts-shdy.md: an Added fragment.docs/adr/0004-the-compiler-surface.md: a dated Amendment at proposed, at the foot (below).Refs: pts-shdy
Evidence
test/export-surface.jsonalone,test/export-surface.test.tsfailed on its assertion, the diff naming exactlyDecompileResult; with the export in place it passes.DecompileResultfrom the re-export insrc/index.tsturns "the declared export surface > pins the names . declares" red on the assertion; the file was restored from a copy, byte-equal.type DecompileResultin their export statement, anddecompileis declared returning it.Direction check of the record text
The entry is an Amendment at proposed, inserted at the foot of ADR-0004, and removes no line (
git diff origin/main...HEAD -- docs/adr/shows no removed line). It is an Amendment rather than a Note because it supersedes an accepted sentence and adds a public name, which changes what the record decides; its Typespecs section quotesDecompileResultassrc/decompile.tsdeclares it, and thedecompiledeclaration that names it. Each claim checked at this branch's head: the amendment headed "decompilerefuses a tree past the source depth bound, as a value" ends its "What changed" section with the sentence the entry quotes;DecompileResultinsrc/decompile.tsis the union that amendment quotes, member for member; the note on that amendment's acceptance reads the export state at1ddd46b, which this change does not alter; the statement-grammar amendment's sentence about unexported result types is about the two located program results, which this change does not export.Provenance
src/index.tsis also edited by a sibling change to the execute entry points; this change touches only the one re-export line.docs/adr/0004-the-compiler-surface.md(that request's body names the file). Both sides only added at the foot; resolved keep-both, Notes ADR-0004's minus sentence and block brace #158's Note first and this entry after it, and the full gate ran green on the rebased head. The rebase also made this entry's own "branch cut from" clause false, so the clause was dropped before the push.