swiftlang/swift

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

Open

#87.830 aberto em 12 de mar. de 2026

Ver no GitHub
 (3 comments) (0 reactions) (1 assignee)Swift (10.719 forks)batch import
SILcapture listsclosurescompilerdiagnostics qualityexpressionsfix-itsgood first issueinoutswift 6.3value capturing

Métricas do repositório

Stars
 (69.989 stars)
Métricas de merge de PR
 (Mesclagem média 7d 6h) (556 fundiu PRs em 30d)

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

Guia do colaborador