Sending a message to self when it is const and within a class method is safe because we know that self is the Class itself.
We can only relax this error in ARC.
Radar-Id: rdar://problem/58581965
Differential D72747
[objc_direct] Allow for direct messages be sent to `self` when it is a Class MadCoder on Jan 14 2020, 8:32 PM. Authored by
Details Sending a message to self when it is const and within a class method is safe because we know that self is the Class itself. We can only relax this error in ARC. Radar-Id: rdar://problem/58581965
Diff Detail Event TimelineComment Actions Please add a test that exercises path without ARC enabled.
|
NIT: It feels easier to read if the condition is && !(Receiver->isObjCSelfExpr() && getLangOpts().ObjCAutoRefCount).