-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Labels
assertion failureBug → crash: An assertion failureBug → crash: An assertion failurebugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.closuresFeature: closuresFeature: closurescompilerThe Swift compiler itselfThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwareexpressionsFeature: expressionsFeature: expressionsgenericsFeature: generic declarations and typesFeature: generic declarations and typespack expansionsFeature → expressions: Pack expansion expressionsFeature → expressions: Pack expansion expressionsparameter packsFeature → generics: Parameter packsFeature → generics: Parameter packsswift 5.9type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis
Description
This code crashes the compiler:
struct SyncedTypes<T1, T2> {
let properties: [(T1, inout T2) -> Void]
init<each V: Equatable>(_ pair: repeat (KeyPath<T1, each V>, WritableKeyPath<T2, each V>)) {
var properties = [(T1, inout T2) -> Void]()
repeat properties.append( { (source: T1, destination: inout T2) in
destination[keyPath: each pair.1] = source[keyPath: each pair.0]
})
self.properties = properties
}
}
Environment
Xcode: Version 15.0 beta 4 (15A5195m)
Deployment target: iOS 17.0
Metadata
Metadata
Assignees
Labels
assertion failureBug → crash: An assertion failureBug → crash: An assertion failurebugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.closuresFeature: closuresFeature: closurescompilerThe Swift compiler itselfThe Swift compiler itselfcrashBug: A crash, i.e., an abnormal termination of softwareBug: A crash, i.e., an abnormal termination of softwareexpressionsFeature: expressionsFeature: expressionsgenericsFeature: generic declarations and typesFeature: generic declarations and typespack expansionsFeature → expressions: Pack expansion expressionsFeature → expressions: Pack expansion expressionsparameter packsFeature → generics: Parameter packsFeature → generics: Parameter packsswift 5.9type checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis