swiftlang/swift

No fix-it for escaping closure captures 'inout' parameter

Open

#87,830 建立於 2026年3月12日

在 GitHub 查看
 (3 留言) (0 反應) (1 負責人)Swift (10,719 fork)batch import
SILcapture listsclosurescompilerdiagnostics qualityexpressionsfix-itsgood first issueinoutswift 6.3value capturing

倉庫指標

Star
 (69,989 star)
PR 合併指標
 (平均合併 8天 17小時) (30 天內合併 510 個 PR)

描述

Description

No response

Reproduction

func bar(_: @escaping () -> Void) {}
func foo(_ i: inout Int) {
  bar {
    _ = i
  }
}

Expected behavior

An additional note asking if the user wants to capture a copy, with a fix-it to capture the parameter explicitly.

Environment

Swift version 6.3-dev (fefcb257b5b5d32)

Additional information

No response

貢獻者指南