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-7674] Compiler crash while working on a type erasurer #50214
Comments
Comment by Guido Marucci Blas (JIRA) OK I found a work-around, instead of declaring private let performEffect: (EffectType) -> EffectResultProducer I declare it without using the typealias inherited from the protocol comformance to private let performEffect: (EffectType) -> SignalProducer<Result<EffectResponseType, EffectErrorType>, NoError> and it compiled. Maybe something clashing when trying to expand the typealias? |
Comment by Guido Marucci Blas (JIRA) Here are swift build crash output for Swift version in Xcode 9.3 and latest 4.2 snapshot. I've also attached a project that reproduces the issue. Apple Swift version 4.1 (swiftlang-902.0.48 clang-902.0.37.1)
Apple Swift version 4.2-dev (LLVM ae60dc0632, Clang 91ee593a0d, Swift 9f28451)
|
Comment by Guido Marucci Blas (JIRA) Here is a twitter thread were I discussed this in case there some replies that can help with this issue -> https://twitter.com/guidomb/status/995810518735753218 |
@slavapestov, @rudkx, sound familiar? |
I need to come up with a stand-alone test case, but the problem might even be with associated type inference. |
I hit this today in our codebase: |
Now that I look at it, this may be a different issue. If we look at |
Apparently this no longer crashes, but still unexpectedly errors out due to what feels like a circularity between associated type inference and type alias resolution. Reduced: protocol P {
associatedtype A
typealias Alias = A
func req(_: Alias)
}
struct Conformer<A>: P {
func nonReq(_: Alias) {}
func req(_: Alias) {} // error: reference to invalid type alias 'Alias' of type 'Conformer<A>'
} Funnily enough the error can be hacked around by swapping Tested with Swift 5.9-dev (c1d5118). |
Attachment: Download
Environment
Xcode Version 9.3 (9E145)
macOS Version 10.13.4 (17E202)
ReactiveSwift 3.1.0 revision 46fb4d4a8285286e54929add1d12f384675895c6
Result 3.2.4 revision 7477584259bfce2560a19e06ad9f71db441fff11
Additional Detail from JIRA
md5: b6710c796fab2d8226271de84635e7dc
Issue Description:
The following code generates a compiler crash
Compiler output:
The text was updated successfully, but these errors were encountered: