swiftlang/swift

[SR-1807] Sema should catch and warn about self capture in closures

Open

#44,416 opened on Jun 17, 2016

View on GitHub
 (6 comments) (0 reactions) (0 assignees)Swift (10,719 forks)batch import
compilergood first issuenew feature

Repository metrics

Stars
 (69,989 stars)
PR merge metrics
 (Avg merge 8d 17h) (510 merged PRs in 30d)

Description

Previous ID SR-1807
Radar rdar://26865978
Original Reporter @CodaFi
Type New Feature
Votes 0
Component/s Compiler
Labels New Feature, StarterBug
Assignee None
Priority Medium

md5: 3ea294e377274fa3d27e3c3b76ff7bbd

Issue Description:

To maintain parity with Objective-C, we should use our ARC analysis pass in Sema to check for the presence of self capture in blocks without weak or @noescape. This should be a very simple warning modeled after the one in /clang/lib/Sema/SemaChecking.cpp void diagnoseRetainCycle().

Contributor guide