On a MacBook, running macOS 10.15.7 with Xcode 12.1, I wrote some classes in Swift that look like the following:
class A {
@objc private var value: NSNumber {
get { ... }
set { ... }
}
}
class B: A {
@objc private var value: String {
get { ... }
set { ... }
}
}
The property is marked @objc so I can bind an input to it. The code compiles and runs perfectly fine without issue, with the input properly binding to the value for either class, and I committed it to my repository.
I later checked out the repository on an iMac, also running macOS 10.15.7 with Xcode 12.1, and it refuses to compile with the following errors:
Getter for 'value' with Objective-C selector 'value' conflicts with getter for 'value' from superclass 'A' with the same Objective-C selector
Setter for 'value' with Objective-C selector 'setValue:' conflicts with setter for 'value' from superclass 'A' with the same Objective-C selector
Why am I getting the errors on one computer but not another, with the exact same project and software?? I'm sure I could rework it somehow to avoid the error, but it would be annoying to do so, especially when I don't really understand why I should rework it, given that it works fine on one machine.