From d370272c8d847f435a4dd3a7dc9a41422cd1c9bb Mon Sep 17 00:00:00 2001 From: Ivan Levin Date: Tue, 9 Dec 2025 15:47:52 +0200 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20entry=20=D0=B2=20=D0=B3=D1=80=D0=B0=D1=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/Container.swift | 1 + Tests/SwinjectTests/ContainerTests.swift | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/Container.swift b/Sources/Container.swift index f6e44430..4bcfcc7c 100644 --- a/Sources/Container.swift +++ b/Sources/Container.swift @@ -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 { diff --git a/Tests/SwinjectTests/ContainerTests.swift b/Tests/SwinjectTests/ContainerTests.swift index c4aa2abf..8e166c96 100644 --- a/Tests/SwinjectTests/ContainerTests.swift +++ b/Tests/SwinjectTests/ContainerTests.swift @@ -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 @@ -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