[CSGen] Detect nested out-of-scope variables in recursive declarations
Follow-up to https://github.com/apple/swift/pull/63505
Since, when the type is not stated, a variable assumes the
type of its initializer that enables out-of-scope variables
to be nested inside of some other concrete type i.e. Optional.
Resolves: https://github.com/apple/swift/issues/63455
(cherry picked from commit 8e82f1d68bbe40b47e23366e36aad2f6ad141192)