New issue
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
[SR-3092] Function-level nested types cannot conform to Equatable #45682
Comments
Even after this is fixed I'm not sure the compiler would find the |
Comment by Ell Neal (JIRA) I didn't mention it in the issue but the compiler is also giving a "Type 'FunctionLevelStruct' does not conform to protocol 'Equatable'", so I think you're right. |
This issue is very annoying when writing tests for |
Comment by Tim (JIRA) This seems to be resolved on the Swift 4.2 toolchain. |
After testing, it seems this was fixed in Swift 4.1. |
This isn't fixed. It appeared to go away with Swift 4.1 because of compiler-synthesized func foo() {
struct Bar: Equatable {
let x: ()
static func ==(lhs: Bar, rhs: Bar) -> Bool {
return true
}
}
} |
>< I feel silly that none of us caught that. Thanks, Lily. Opened a new Radar. |
Environment
Swift build number: Xcode 8.1 (8B62) embedded version
Target OS: iOS
Build OS: macOS Sierra 16A323
Build Tool: Xcode Version 8.1 (8B62)
Additional Detail from JIRA
md5: f04b40d7c56cb16b9b79a99c8f79b080
is duplicated by:
relates to:
Issue Description:
The compiler fails to compile a struct that conforms to
Equatable
inside a function.The text was updated successfully, but these errors were encountered: