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-13555] Compiler crash when emitting IR #55992
Comments
@swift-ci create |
sagishm (JIRA User) Thanks for your report! Unfortunately, the code here is not quite enough to trigger the compiler crash. Adding types until to compiles results in the following which compile without issue with Xcode 12 GM (Apple Swift version 5.3 (swiftlang-1200.0.29.2 clang-1200.0.30.1)). ``` public struct LoginApiError<T: GigyaAccountProtocol> { Can you provide a bit more code that when compiled on its own results in the crash? |
Comment by Sagi Shmuel (JIRA) Hi @nate-chandler , we are open-source so you can see the all source files. https://github.com/SAP/gigya-swift-sdk/blob/master/GigyaSwift/Network/Request/GigyaApiResult.swift https://github.com/SAP/gigya-swift-sdk/blob/master/GigyaSwift/Network/Service/NetworkError.swift https://github.com/SAP/gigya-swift-sdk/blob/master/GigyaSwift/Models/Tfa/TFAModels.swift Also i add a demo app. Thanks |
Comment by Sagi Shmuel (JIRA) Another solution was found, so when moving the `LoginApiError` above the `GigyaLoginResult` the compiler stop crashes. |
You can also work around the issue by adding "-Xfrontend -disable-type-layout" to the "Other Swift Flags" build setting. A small repro: public protocol P {}
public class Ref<T: P> {}
public enum E1<R: P> {
case first(R)
case second(S<R>)
}
public struct S<T: P> {
public let f: E2<T>? = nil
}
public enum E2<T: P> {
case first(Ref<T>)
case second(String)
} % swiftc -O Repro.swift
<crash>
% swiftc -O -Xfrontend -disable-type-layout Repro.swift
% |
Attachment: Download
Environment
Xcode Version 12.0 (12A7209)
Additional Detail from JIRA
md5: 8c03d92935ef6c2e620c09ffcd51105b
Issue Description:
I have a compiler error when used following code:
When changing the struct to class it compiles successfully.
The text was updated successfully, but these errors were encountered: