We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
md5: 47a3ac0c7848378bcee028764cdee97d
duplicates:
Issue Description:
The following code generates error:
error: cannot assign to property: 'self' is immutable
**x = 1**
class MyClass { } protocol MyProtocol where Self: MyClass { var x: Int { get set } func mutatingFunc() } extension MyProtocol { func mutatingFunc() { x = 1 } }
A workaround is to change protocol definition:
protocol MyProtocol: class where Self: MyClass {
but in this case you get the warning:
Redundant constraint 'Self' : 'AnyObject'
The text was updated successfully, but these errors were encountered:
cc @slavapestov
Sorry, something went wrong.
This works on master, but you have to write 'protocol MyProtocol : MyClass' instead of 'where Self : MyClass'.
No branches or pull requests
Additional Detail from JIRA
md5: 47a3ac0c7848378bcee028764cdee97d
duplicates:
Issue Description:
The following code generates error:
error: cannot assign to property: 'self' is immutable
A workaround is to change protocol definition:
but in this case you get the warning:
Redundant constraint 'Self' : 'AnyObject'
The text was updated successfully, but these errors were encountered: