docs(spec): make the count zero-rule context-dependent per consumer (0083)
The count description claimed every count must be "positive integral", which is wrong: zero is context-dependent. Verified at HEAD — an array dimension (`[0]s64`) and a generic value-param count (`Box(0)`, $N:u32) both accept zero as a length-0 instantiation, while a `Vector` lane count stays strictly positive (`Vector(0,f32)` rejected). Negatives are rejected for array dims and unsigned value-params, but a signed value-param accepts a negative; only the integral requirement (folds 4.0, rejects 4.5) is common to all three. Split the count paragraph into per-consumer bullets stating the exact range each accepts. Range-bound paragraph unchanged. Pin the zero contrast with examples 0147 (array-dim + value-param zero accepted) and 1505 (Vector zero-lane rejected). No compiler-code change.
This commit is contained in:
1
examples/expected/0147-types-zero-count-context.exit
Normal file
1
examples/expected/0147-types-zero-count-context.exit
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
2
examples/expected/0147-types-zero-count-context.stdout
Normal file
2
examples/expected/0147-types-zero-count-context.stdout
Normal file
@@ -0,0 +1,2 @@
|
||||
array_dim=0
|
||||
value_param=0
|
||||
1
examples/expected/1505-vectors-zero-lane-rejected.exit
Normal file
1
examples/expected/1505-vectors-zero-lane-rejected.exit
Normal file
@@ -0,0 +1 @@
|
||||
1
|
||||
5
examples/expected/1505-vectors-zero-lane-rejected.stderr
Normal file
5
examples/expected/1505-vectors-zero-lane-rejected.stderr
Normal file
@@ -0,0 +1,5 @@
|
||||
error: Vector lane count must be a positive compile-time integer constant
|
||||
--> examples/1505-vectors-zero-lane-rejected.sx:13:16
|
||||
|
|
||||
13 | v : Vector(0, f32) = ---;
|
||||
| ^
|
||||
Reference in New Issue
Block a user