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
Compiler crash when calling throwing function after initializing type with parameters pack #73044
Labels
assertion failure
Bug → crash: An assertion failure
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
crash
Bug: A crash, i.e., an abnormal termination of software
error handling
expressions
Feature: expressions
generics
Feature: generic declarations and types
pack expansions
Feature → expressions: Pack expansion expressions
properties
Feature: properties
SILGen
Area → compiler: The SIL generation stage
swift 6.0
variadic generics
Feature → generics: Variadic generics
verifier
Comments
martialln
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
triage needed
This issue needs more specific labels
labels
Apr 16, 2024
I reproduced the error with: Xcode Version 15.3 (15E204a) |
Reduced: protocol Initable {
init() throws
}
func foo() throws {}
struct S<each Element: Initable> {
var elements: (repeat each Element)
init() throws {
self.elements = (repeat try (each Element).init())
try foo()
}
}
|
AnthonyLatsis
added
compiler
The Swift compiler in itself
SILGen
Area → compiler: The SIL generation stage
verifier
generics
Feature: generic declarations and types
error handling
expressions
Feature: expressions
properties
Feature: properties
variadic generics
Feature → generics: Variadic generics
assertion failure
Bug → crash: An assertion failure
pack expansions
Feature → expressions: Pack expansion expressions
swift 6.0
and removed
triage needed
This issue needs more specific labels
labels
Apr 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
assertion failure
Bug → crash: An assertion failure
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
crash
Bug: A crash, i.e., an abnormal termination of software
error handling
expressions
Feature: expressions
generics
Feature: generic declarations and types
pack expansions
Feature → expressions: Pack expansion expressions
properties
Feature: properties
SILGen
Area → compiler: The SIL generation stage
swift 6.0
variadic generics
Feature → generics: Variadic generics
verifier
Description
I have a type which use parameter pack as generic parameter.
When initializing, I have to call a throwing function after initializing all properties. When doing so the compiler crash.
Not that if I'm calling a non-throwing function, the compilation succeed without error.
Also if I use
try?
to ignore the thrown error, the compilation succeed without error.Reproduction
Stack dump
Expected behavior
The compiler doesn't crash and compile correctly
Environment
Xcode
Version 15.2 (15C500b)
Toolchain: Swift Development Snapshot 2024-04-13 (a)
macOS 14.4.1 (23E224)
Additional information
Also reproduced using the toolchain shipped with Xcode (stack dump is different though) and with toolchain "Swift 6.0 Development Snapshot 2024-04-14 (a)"
The text was updated successfully, but these errors were encountered: