You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
compiles without a diagnostic today. Superficially, it might seem like you can override f from a subclass of C. However, that's not the case; you can only overload it. Being able to override methods declared in extensions would require a mechanism like objc_msgSend, which is why such overloading only works when @objc is present, there is no Swift equivalent for pure Swift classes.
This means that the open is misleading to a reader; we should issue a diagnostic with a fix-it to replace this with public instead in such situations.
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: f58fc20f557cce2f2ade639d7c1ce432
Issue Description:
The following code snippet:
compiles without a diagnostic today. Superficially, it might seem like you can override
f
from a subclass ofC
. However, that's not the case; you can only overload it. Being able to override methods declared in extensions would require a mechanism likeobjc_msgSend
, which is why such overloading only works when@objc
is present, there is no Swift equivalent for pure Swift classes.This means that the
open
is misleading to a reader; we should issue a diagnostic with a fix-it to replace this withpublic
instead in such situations.The text was updated successfully, but these errors were encountered: