swiftlang/swift

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

Open

#87.830 aperta il 12 mar 2026

Vedi su GitHub
 (3 commenti) (0 reazioni) (1 assegnatario)Swift (10.719 fork)batch import
SILcapture listsclosurescompilerdiagnostics qualityexpressionsfix-itsgood first issueinoutswift 6.3value capturing

Metriche repository

Star
 (69.989 star)
Metriche merge PR
 (Merge medio 7g 6h) (556 PR mergiate in 30 g)

Descrizione

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

Guida contributor