BlockstreamResearch / rust-simplicity

Creative Commons Zero v1.0 Universal
58 stars 12 forks source link

Cap maximum depth of incomplete type display #221

Closed apoelstra closed 2 months ago

apoelstra commented 2 months ago

This limit may still be too high -- I think you can output a 2^64 sized type which will wreck any terminal. But at least it's finite now.

Every instance of _iter methods called on an incomplete type (in the types/ module anyway) now has a maximum depth on it, which should eliminate all the places where we might loop forever with incomplete types.

Fixes #177

apoelstra commented 2 months ago

Reordered commits and rewrote the regression test to use the human-readable encoding. Conveniently with the human-readable encoding I can test both the bind error and the occurs-check error at once, since it attempts to continue after the first error.