Issue with computing closure captures in diagnostic function for implicit self use

For reference, the current architecture (where the capture list is a parent of the closure expression) is discussed here, and the PR that introduced that change is linked for further context.