[SR-7198] Using self in computed let #49746
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
diagnostics QoI
Bug: Diagnostics Quality of Implementation
duplicate
Resolution: Duplicates another issue
expressions
Feature: expressions
identifiers
Feature: Identifiers
missing warning
Bug: Missing warning
self
Feature → expressions: The 'self' expression
swift 5.6
type checker
Area → compiler: Semantic analysis
Attachment: Download
Environment
Xcode Version 9.2 (9C40b)
Swift 4
Additional Detail from JIRA
md5: 04555a2ce1020475bcf49a13514222fd
duplicates:
Issue Description:
See the attached project, relevant code here:
If you run this and press the button it will print:
If you put a breakpoint in Test.addTarget and when hit run
po target!
in lldb, continue, then press the button, you get a crash:unrecognized selector sent to instance
The behaviour of this code is, I believe, undefined. Should
self
be the closure, in which case the crash should occur every time, or should this generate a compiler error as self is not valid in this context?The text was updated successfully, but these errors were encountered: