Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Send allowed in Operator #163

Closed
jam40jeff opened this issue Oct 18, 2018 · 0 comments
Closed

Fix Send allowed in Operator #163

jam40jeff opened this issue Oct 18, 2018 · 0 comments
Assignees
Labels

Comments

@jam40jeff
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant