Why this fires¶
TE720 reports an assignment to a derived signal declared with
let<signal>. A derived cell is defined by its initializer and is recomputed
from the source cells it reads; it is not writable state.
var<signal> price = 30
var<signal> quantity = 2
let<signal> total = price * quantity
total = 10
// error[TE720]: cannot assign to a derived cellAllowing the assignment would make total disagree with its dependency graph
until the next recomputation.
Fix it¶
Update one of the writable source cells:
price = 5
quantity = 2
// total is now derived as 10If the value must be independently writable, declare it as var<signal> and
own the synchronization logic explicitly. If it is purely computed, keep
let<signal> and change only its inputs.