mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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
This commit is contained in:
committed by
Pavel Yaskevich
parent
0b58685ace
commit
8e82f1d68b
@@ -74,7 +74,7 @@ public:
|
||||
if (auto *DRE = dyn_cast<DeclRefExpr>(expr)) {
|
||||
auto *decl = DRE->getDecl();
|
||||
|
||||
if (auto type = CS.getTypeIfAvailable(DRE->getDecl())) {
|
||||
if (auto type = CS.getTypeIfAvailable(decl)) {
|
||||
auto &ctx = CS.getASTContext();
|
||||
// If this is not one of the closure parameters which
|
||||
// is inferrable from the body, let's replace type
|
||||
|
||||
Reference in New Issue
Block a user