Open s0ta91 opened 2 weeks ago
This might just be a compiler issue, not really sure what's going on here, but I'm logging it so it can be referenced.
When building to a device with OS17.x from Xcode 16, I have the following crash in CheckResolver.swift line 63 in this function:
CheckResolver.swift
func checkResolved<Service, A, B, C, D>(initializer: ((A, B, C, D)) -> Service, services a: A?, _ b: B?, _ c: C?, _ d: D?){ let unresolved = ( [a, b, c, d] as [Any?] ).filter { $0 == nil } if unresolved.count > 0 { let errorMessage = resolutionErrors(forInitializer: initializer).map { "\($0.message)\n" }.joined() fatalError("SwinjectAutoregistration: Resolution failed.\n\(errorMessage)Unresolved service: \(unresolvedService(a, b, c, d)!)\nInitializer: (\(A.self), \(B.self), \(C.self), \(D.self)) -> \(Service.self)") } }
unresolved.count is equals to 1 Here's the different results I have for OS17.x and OS18
unresolved.count
Build from Xcode 16 to iOS 17.5 => Crash
po ( [a, b, c, d] as [Any?] ) ▿ 4 elements 0 : nil ▿ 1 : Optional ▿ some : <DefaultPassRepository: 0x106305a80> ▿ 2 : Optional ▿ some : <DefaultProfileRepository: 0x10800c800> ▿ 3 : Optional ▿ some : <DefaultEnvironmentRepository: 0x108824000> unresolved: ▿ 1 element 0 : nil
po ( [a, b, c, d] as [Any?] ) ▿ 4 elements
unresolved: ▿ 1 element
Build from Xcode 16 to iOS 18 => Ok
po ( [a, b, c, d] as [Any?] ) ▿ 4 elements 0 : Optional ▿ some : nil ▿ 1 : Optional ▿ some : <DefaultPassRepository: 0x106305a80> ▿ 2 : Optional ▿ some : <DefaultProfileRepository: 0x10800c800> ▿ 3 : Optional ▿ some : <DefaultEnvironmentRepository: 0x108824000> unresolved: ▿ 0 element
unresolved: ▿ 0 element
Could you also share a code snippet for the registration that reproduces the crash?
This might just be a compiler issue, not really sure what's going on here, but I'm logging it so it can be referenced.
When building to a device with OS17.x from Xcode 16, I have the following crash in
CheckResolver.swift
line 63 in this function:unresolved.count
is equals to 1 Here's the different results I have for OS17.x and OS18Build from Xcode 16 to iOS 17.5 => Crash
Build from Xcode 16 to iOS 18 => Ok