cli: reject non-value operands without aborting lowering
This commit is contained in:
1 parent
bc5412dadd
commit
dcd5f1f702
83 files changed
+1042
-38
No files matched your search
@@ -406,6 +406,7 @@ A byte string or array used where a `slice<u8>` is expected is materialized in f
|
||||
- Copy content of `own_array<T>` and the repeated value of `own.array`; an invalid content type is E7005 at that annotation/value, with `constraint: Copy` and `type_constructor: own_array`. Known linear content in unused generic signatures and static contracts MUST reject; unknown type parameters are checked after substitution.
|
||||
- Inferred array literal elements MUST satisfy the existing member-position rules. Borrowed elements reject E7006 `invalid_literal`; other invalid constructors reject E7005 at the element with `position: member` and `type_constructor`. Lists preserve explicit linear transfers; repetitions MUST satisfy Copy.
|
||||
- Inferred content of `own.new`, `own.pack`, `region.new`, `region.array`, `mutex.make`, `island.create`, `island.alloc` and `arc.new` MUST be a value: `void`/`never` reject E7005 at the content argument, with `position: member` and `type_constructor`. `own.new` and region storage MUST require Copy (E7005 with `constraint: Copy` and `operation`); `own.pack` MUST reject borrowed content (E7005 with `position: member` and `type_constructor`) while preserving complete linear transfers and failure recovery. These checks follow ordinary explicit-move checks and precede allocation authority checks. Graph-content properties, reserved transfers and concurrency checks otherwise retain their verifier diagnostics; `own.array` retains its Copy diagnostic above.
|
||||
- A typed operand needed by an operation MUST yield a value: `never` rejects E7005 at that operand with `expected` and `found: never`, before later operands or instruction emission. This includes calls, operators, aggregate inputs, conditions, ranges, indices, sizes and the value stored through `*`, a field or an index. For a place store this check precedes borrowing/evaluating the target; an unknown target type uses `expected: a stored value`. Existing void/type mismatches retain their diagnostics. Divergence in returns, tails, statements and if/match arms remains valid. Assignment to a variable by name and `var` initialization MAY diverge after the ordinary binding/annotation checks; no store is emitted for either SSA or frame storage. `let` still requires a value. Expressions emitted after unconditional divergence MUST reject E7006 `unreachable`, never abort the compiler.
|
||||
|
||||
Source type annotations MUST satisfy the existing AIR type-position rules (spec 07 §8.3/§8.8), including nested constructors. An invalid constructor is E7005 at its annotation, with `position` and `type_constructor` fields. Known constructors in unused generic signatures and static function contracts MUST be checked; restrictions depending on a type parameter are checked after substitution. Graph-content properties and feature gates for otherwise correctly positioned types retain their verifier diagnostics.
|
||||
|
||||
|
||||
Reference in new issue
Block a user