Description
The following code is causing a compiler crash, with the error message Assertion failed: (origPackType.matchesPack(substPackType)), function PackElementGenerator, file AbstractionPattern.cpp, line 804 (Full output/stack dump).
if #available(macOS 14.0.0, *) {
struct Tuple<each Element> {
let element: (repeat each Element)
init(_ element: repeat each Element) {
self.element = (repeat each element)
}
}
struct Wrapper<each Element> {
let content: Tuple<repeat each Element>
init(_ content: () -> Tuple<repeat each Element>) {
self.content = content()
}
}
_ = Wrapper { Tuple(1, 2) }
}
Steps to reproduce
Build the script with the latest Swift development snapshot.
Expected behavior
The compiler shouldn't crash.
Environment
Swift compiler version info: swift-DEVELOPMENT-SNAPSHOT-2023-08-03-a.xctoolchain, Apple Swift version 5.9-dev (LLVM 880cf58f10f5f0a, Swift f62c6c062e55591)
Xcode version info: Xcode 14.2, Build version 14C18
Deployment target: macOS 12.6.8 (21G725)
Additional context
The script compiles if you use an intermediate closure variable:
let closure = { Tuple(1, 2) }
_ = Wrapper(closure)
Description The following code is causing a compiler crash, with the error message
Assertion failed: (origPackType.matchesPack(substPackType)), function PackElementGenerator, file AbstractionPattern.cpp, line 804
(Full output/stack dump).Steps to reproduce Build the script with the latest Swift development snapshot.
Expected behavior The compiler shouldn't crash.
Environment
swift-DEVELOPMENT-SNAPSHOT-2023-08-03-a.xctoolchain
, Apple Swift version 5.9-dev (LLVM880cf58f10f5f0a
, Swiftf62c6c062e55591
)Additional context The script compiles if you use an intermediate closure variable: