AliSoftware/Dip

Xcode 10.2 Crash

ccarranzaD3 opened this issue · 2 comments

The library seems to be crashing at runtime in Xcode 10.2. I made sure the pod is building with swift 4.2 as its swift version but this particular line seems to be causing the issue in AutoInjection.swift line 47.

private func resolveChild(child: Mirror.Child) throws {
    //HOTFIX for https://bugs.swift.org/browse/SR-2282
    guard !String(describing: type(of: child.value)).has(prefix: "ImplicitlyUnwrappedOptional") else { return }
    ...
  }

If I comment out that line, it runs just fine. I could make a PR and wrap it in a swift version check, but as I said I'm have it set as a swift 4.2 pod which it is. Any help would be appreciated.

You can disable auto injection by setting autoInjectProperties tofalse when creating container, so this code that causes a crash for you won't be called.

Thanks, this saved my day!