mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fix lifetime_dependence_borrow_fail diagnostic.
Report the correct variable name.
This commit is contained in:
@@ -597,6 +597,11 @@ struct VariableIntroducerUseDefWalker : LifetimeDependenceUseDefWalker {
|
||||
if let inst = value.definingInstruction, VariableScopeInstruction(inst) != nil {
|
||||
return introducer(value, owner)
|
||||
}
|
||||
// Finding a variable introducer requires following the mark_dependence forwarded value, not the base value like the
|
||||
// default LifetimeDependenceUseDefWalker.
|
||||
if value is MarkDependenceInst {
|
||||
return walkUpDefault(forwarded: value, owner)
|
||||
}
|
||||
return walkUpDefault(dependent: value, owner: owner)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user