swiftlang/swift

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

Open

#87 830 ouverte le 12 mars 2026

Voir sur GitHub
 (3 commentaires) (0 réactions) (1 assigné)Swift (10 719 forks)batch import
SILcapture listsclosurescompilerdiagnostics qualityexpressionsfix-itsgood first issueinoutswift 6.3value capturing

Métriques du dépôt

Stars
 (69 989 stars)
Métriques de merge PR
 (Merge moyen 7j 6h) (556 PRs mergées en 30 j)

Description

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

Guide contributeur