You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
t27c: inline ; comment prose is tokenized -- "this test documents" mints a phantom TestBlock declaration [parked, foreign fix] #8581
t27c: inline ; comment prose is tokenized -- "this test documents" mints a phantom TestBlock declaration
Parked under the 2026-10-05 own-language rule: the fix is in bootstrap/src/compiler.rs (hand-written Rust); it needs the owner's owner-approved-foreign label. This issue records the defect and the exact lead so the fix is a small, already-scoped change when it is unblocked.
Defect
t27c check on a spec whose inline comment prose contains the word test (or bench, fn, struct, enum) followed by an identifier reports a duplicate declaration for a block that does not exist. Repro from master specs/compiler/optimizer.t27 (#8502):
var result = true ; Placeholder for actual test implementation
...
then result == true ; This test documents the requirement - calls should be preserved
produces:
warning: `test implementation` is declared 2 times -- every backend rejects a redeclaration
warning: `test documents` is declared 2 times -- every backend rejects a redeclaration
Lab-verified both directions: reword only the comments -> 0 warnings; restore -> 2 warnings. The AST walk that reports it is honest (collect_top_level_decls, bootstrap/src/compiler.rs:25529, walks NodeKind::TestBlock children and reads child.name) -- the phantom TestBlock node already exists by then, so the token that minted it was produced upstream: inline ; comment text reaches the parser as tokens. Full-line comments are stripped (the corpus is full of them); the inline form after code on the same line is what leaks.
A comment can collide with a REAL declaration and hide it in the same warning.
The class is the repo's recorded one: prose that the compiler silently misreads (cf. the ;-alone-on-a-line trap that discards a module declaration).
Fix shape (for whoever unblocks it)
Strip ;-to-EOL in the tokenizer for the inline position too (or prove which layer keeps the text and strip there), add the optimizer comment shape as a fixture in bootstrap/tests/duplicate_declarations.rs asserting the phantom node is gone, and keep the prose-reading negative control (a comment MAY contain the word test; it must not mint a node).
Activity
optimizer.t27: comment prose minted phantom test declarations -- rewo…
corpus: repair the five unexpected failures at 760a787 + dupe-bodies …