swiftlang/swift

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

Open

#87.830 geöffnet am 12. März 2026

Auf GitHub ansehen
 (3 Kommentare) (0 Reaktionen) (1 zugewiesene Person)Swift (10.719 Forks)batch import
SILcapture listsclosurescompilerdiagnostics qualityexpressionsfix-itsgood first issueinoutswift 6.3value capturing

Repository-Metriken

Stars
 (69.989 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 7T 6h) (556 gemergte PRs in 30 T)

Beschreibung

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

Contributor Guide