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
Variadic generics crash with Embedded Swift in SILCloner #72117
Comments
MaxDesiatov
added
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
crash
Bug: A crash, i.e., an abnormal termination of software
SIL
labels
Mar 6, 2024
Hi, I am experiencing the same issue when compiling the following code with Whole Module Optimization and Testability enabled. There is no crash if I compile it either without WMO or testability. Xcode: 15.3, Swift: 5.10. public protocol View {}
public struct TupleView<T>: View {
var children: T
init<each Content>(_ content: repeat each Content)
where repeat each Content: View, T == (repeat each Content) {
children = (repeat each content)
}
}
@resultBuilder
public struct ViewBuilder {
public static func buildBlock<each Content>(_ content: repeat each Content) -> TupleView<(repeat each Content)> where repeat each Content: View {
TupleView(repeat each content)
}
} A minimal reproducible SPM project is here: https://github.com/persidskiy/swift-wmo-crash Stacktrace:
|
rjmccall
added a commit
to rjmccall/swift
that referenced
this issue
Apr 11, 2024
It seems really unfortunate that we use SILCloner to, basically, implement a recursive visitor of the types used in a SIL function, but apparently it's what we do. Fixes apple#72117.
rjmccall
added a commit
to rjmccall/swift
that referenced
this issue
Apr 12, 2024
It seems really unfortunate that we use SILCloner to, basically, implement a recursive visitor of the types used in a SIL function, but apparently it's what we do. Fixes apple#72117.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
When building a snippet that contains variadic generics with
swiftc -enable-experimental-feature Embedded -wmo repro.swift
with latest development snapshot of themain
branch of the toolchain, the compiler crashes inswift::SILCloner
.Reproduction
Stack dump
Expected behavior
Variadic generics snippet compiles successfully or an actionable diagnostic error message is produced.
Environment
Apple Swift version 6.0-dev (LLVM 7fe091223bc821e, Swift 92f5eee)
Target: arm64-apple-macosx14.0
Additional information
No response
The text was updated successfully, but these errors were encountered: