Skip to content

Resolve failure when building from Xcode 16 to a device with OS17. #92

@s0ta91

Description

@s0ta91

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:

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

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions