[TM-379] Go into deep lambdas in dfsInstr
Description
Problem: dfsInstr
has a flag that specifies whether it should
be applied to instructions inside lambdas. When this flag is enabled,
it applies recursion to PUSH lambda
case. But it treats all other
PUSH
es as if they didn't contain any instructions.
However, there can be values of a type different from lambda
that
contain instructions, e. g. pair a (lambda b c)
.
Currently instructions in such values are ignored.
Solution: apply dfsValue
when we encounter PUSH
regardless of the
type of the pushed value. This dfsValue
's step recursively calls
our dfsInstr
.
The test added in this commit confirms there was this problem.
Related issue(s)
https://issues.serokell.io/issue/TM-379
✅ Checklist for your Merge Request
Related changes (conditional)
-
Tests (see short guidelines)
-
If I added new functionality, I added tests covering it. -
If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
-
-
Documentation
Stylistic guide (mandatory)
-
My commits comply with the following policy. -
My code complies with the style guide.