When reversing, only outer parameters are used if captured parameters are nested. Added tests to check the edge cases and documentation for the behavior with an example to avoid it. Backport of 23a5d64f40 from master
23a5d64f40