The following code should throw an exception but does not:
StreamSink<int> s = Stream.CreateSink<int>();
Cell<int> c = Cell.Constant(0);
c.Map(_ =>
{
s.Send(0);
return Unit.Value;
}).Listen(_ => { });
The problem is that the code to check if Send was called within a Transaction doesn't apply for the first value created from a Cell (through HoldLazyInternal via LazyBehavior). LazyBehavior needs to guard against Send in its initial value creation just like Transaction.Prioritized does.
The following code should throw an exception but does not:
The problem is that the code to check if
Send
was called within aTransaction
doesn't apply for the first value created from aCell
(throughHoldLazyInternal
viaLazyBehavior
).LazyBehavior
needs to guard againstSend
in its initial value creation just likeTransaction.Prioritized
does.