Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Sources/Container.swift
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ extension Container: Resolver {
return persistedInstance
}
entry.storage.setInstance(resolvedInstance as Any, inGraph: currentObjectGraph)
graphInstancesInFlight.append(entry)

if let completed = entry.initCompleted as? (Resolver, Any) -> Void,
let resolvedInstance = resolvedInstance as? Service {
Expand Down
4 changes: 2 additions & 2 deletions Tests/SwinjectTests/ContainerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class ContainerTests: XCTestCase {

parent.register(Cat.self) { _ in Cat() }
weak var weakCat = child.resolve(Cat.self)
XCTAssertNotNil(weakCat)
XCTAssertNil(weakCat)
}

#if !SWIFT_PACKAGE
Expand Down Expand Up @@ -227,7 +227,7 @@ class ContainerTests: XCTestCase {
.inObjectScope(.weak)

weak var cat = container.resolve(Animal.self) as? Cat
XCTAssertNotNil(cat)
XCTAssertNil(cat)
}

// MARK: Init completed event
Expand Down