Closed naegelejd closed 5 months ago
This bug can be avoided (masked) by
r.ReadStrings(std::string)
read methodThe reason is that the generated Close
method doesn't perform the same state check(s) that are performed per-step, specifically the
if stepIndex > 0 && protocol.Sequence[stepIndex-1].IsStream() {
fmt.Fprintf(w, "if (state_ == %d) {\n", previousUnobservedcompletionState)
...
check currently performed in the writeReaderStateCheckIfStatement
function in protocols.go
.
Solution: We can just add this check for stream steps in the generated Close method.
If:
Using 28aa4af and the following model:
and the following demonstration program:
the call to
r.Close()
throws the following error: