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
typesanitizer opened this issue
Dec 12, 2020
· 3 comments
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfparserArea → compiler: The legacy C++ parser
protocolP {
varx : Int {
get { 0 }
// ^ error: expected get or set in a protocol property
}
}
One might look at the diagnostic and think "well, I just wrote a getter, so duh!".
I think we should provide a clearer diagnostic saying that you cannot provide a default implementation for a getter in a protocol, or something along those lines.
The text was updated successfully, but these errors were encountered:
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfparserArea → compiler: The legacy C++ parser
Additional Detail from JIRA
md5: bb0423b199cd83b20b20657513db7389
Issue Description:
Code example:
One might look at the diagnostic and think "well, I just wrote a getter, so duh!".
I think we should provide a clearer diagnostic saying that you cannot provide a default implementation for a getter in a protocol, or something along those lines.
The text was updated successfully, but these errors were encountered: