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-661] Compiler error: Eureka library no longer compiles on Xcode 7.3 beta 2 #43276
Comments
Yikes. @jckarter, who would be good to check this out? |
Sounds like a regression from @rjmccall's work. |
John's out this week. Let me see if I can get a workaround in place to keep 2.2 from regressing. |
When compiling in 7D141l, I get a disembodied error message: <unknown>:0: error: initializer requirement 'init' can only be satisfied by a `required` initializer in the definition of non-final class 'Section' |
mtnbarreto (JIRA User) To keep you up-to-date: Eureka's managed to reveal quite a chain of regressions. The aforementioned disembodied error message was fixed by @DougGregor in #1330 @slavapestov fixed a SIL generation regression in #1359 but we hit another one after that, which we're currently investigating. We also stumbled into an LLVM generation bug when experimenting with workarounds. |
Comment by Martin Barreto (JIRA) @jckarter Thanks for the update and the great work! Can we expect to get this fixed before XCode7.3 official release? |
mtnbarreto (JIRA User), @slavapestov's still looking into it, but from discussion with him it sounds like a proper fix might be at risk at this point. You might be able to adopt a workaround though. AIUI the problem arises from a protocol extension with a base class constraint on `Self` and an associated type satisfied by the base class constraint: protocol P { associatedtype T }
class Base { typealias T = Int }
extension P where Self: Base { ... } The compiler has trouble resolving associated type requirements that should be satisfied by base class constraints. You can avoid the problem by adding a redundant same-type constraint to the associated type in the protocol extension: extension P where
Self: Base,
// FIXME: Should be redundant with the above
T == Int
{ ... } |
Comment by Martin Barreto (JIRA) @jckarter Thanks for the suggestions. I was able to "fix" most of the library issues by making some changes on the library protocol hierarchy, extension and generic type constraints as you suggested. However I ran into this issue: http://www.openradar.me/23358609 trying to conform to `RangeReplaceableCollectionType` which among other things requires a init(). Even though I provide a `public required init()` implementation the compiler keeps returning `Initializer requirement 'init' can only be satisfied by a `required` initializer in the definition of non-final class 'Section'`. Making `Section` class final, fixes the problem but I can not make `Section` final since I need to extend it. Any help would be greatly appreciated!! I can provide any additional information and the updated code if you want to look into it. |
We encountered and fixed that issue as well. I think it's fixed in the 2.2 branch now, if you want to try a newer Xcode beta or Swift.org toolchain. |
The last of the problems with this project was fixed by on the Swift master branch. Unfortunately, there's too long of a trail of potentially-destablizing fixes to pull all of these into Swift 2.2 |
Comment by Martin Barreto (JIRA) @jckarter @DougGregor It seems http://www.openradar.me/23358609 no longer happens in https://ci.swift.org/view/Packages/job/oss-swift-2.2-package-osx/ws/swift-2.2-SNAPSHOT-2016-02-24-a-osx.tar.gz . That's great! I only have one compilation error left to make the library work on 2.2. Something interesting is that PickerInlineRow.swift is pretty similar to DateInlineRow but it compiles. The only difference from DateInlineRow is that PickerInlineRow is generic so I made DateInlineRow a generic type adding <T> and it compiles successfully. ``` @DougGregor I think this issue should not be closed yet since Eureka generic types, protocols hierarchy and protocol oriented adoption are not that complex and it's just using swift standard features. On top of that it was working properly prior swift 2.2. I'm waiting for CI master branch snapshot to see if it works using it. |
It's been fixed for Swift 3, and we determined that it's too destabilizing to take more changes into the Swift 2.2 branch to address this regression, given that there are workarounds. I know it's frustrating to have Swift 2.2 ship with a regression on your project. |
Comment by Martin Barreto (JIRA) for now i will add a typealias so i don't introduce any breaking changes to Eureka (at least for the basic usage)
|
Attachment: Download
Environment
`Apple Swift version 2.2 (swiftlang-703.0.6 clang-703.0.16)`
`Target: x86_64-apple-macosx10.9`
swift folder: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift
Additional Detail from JIRA
md5: c88ed59e26c266d2818e2a82e6072c2c
Issue Description:
Additional Info:
The text was updated successfully, but these errors were encountered: