Fix -Wterm-variable-capture scope (#23434)
Fixed #23434 (closed)
There is a good description of the problem here.
I added a new function newImplicitTyVarNameRn
that does everything that newTyVarNameRn
does plus checks if an implicitly quantified type variable shadows a term-level variable and warns in this case. That allows us to reuse information received by environment lookup in case we are in associated type signature.