Repository navigation
Description
Problem
When two target attributes precede an item, an inactive first condition can consume only the next attribute line, leaving the function unconditional.
Reproduction and evidence
Audited canonical master 69a67c6e0fb700f37ee6114f5a66d37ee13771a5 (0.0.1-alpha-dev). Matching checkout-built compiler/std were used for compiler probes on Linux amd64 with Rust 1.89.0 and LLVM 21.1.8. Artifact inspection, mocked/projection checks and foreign-target object emission are identified below and are not native execution on those operating systems.
#[target(os="windows")]
#[target(arch="x86_64")]
fun omitted()->i32{return 7;}
fun main()->i32{return omitted();}
target/debug/wavec --std-root "$PWD/std" build repro.wave --emit=check
target/debug/wavec --std-root "$PWD/std" build repro.wave --emit=ir --out-dir outObserved on Linux x86_64: both commands succeed and IR contains omitted(), despite its Windows-only first attribute. This does not assume stacked attributes are already an approved syntax; unsupported combinations must fail closed rather than erase a condition.
Scope
Decide stacked target syntax and preserve every applicable condition or reject the combination explicitly.
Starting points: front/parser/src/import.rs:1.
Design discussion required
Recommended if stacking is supported: combine conditions with AND. Alternative: reject repeated target attributes with a source diagnostic. Make the grammar/policy choice before implementation.
Please mention @LunaStev to discuss the design before starting implementation.
Completion criteria
- A false condition never silently becomes unconditional code.
- Cover false/true permutations, more than two attributes and following declarations.
- Preserve the current single-attribute behavior and source coordinates.
Related: #729, #950. Related broad trackers or completed implementations are context, not claims that their entire scope is unfinished.
Activity