From 5575eba6b4c31ccea5996afe8a89cc91af2249de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helge=20He=C3=9F?= Date: Sun, 1 Oct 2023 20:15:46 +0200 Subject: [PATCH] Properly process frozen entities They just got skipped from the result set, which is wrong. --- .../ManagedModels/SchemaGeneration/SchemaBuilder.swift | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Sources/ManagedModels/SchemaGeneration/SchemaBuilder.swift b/Sources/ManagedModels/SchemaGeneration/SchemaBuilder.swift index 8e48fc0..ccc1b46 100644 --- a/Sources/ManagedModels/SchemaGeneration/SchemaBuilder.swift +++ b/Sources/ManagedModels/SchemaGeneration/SchemaBuilder.swift @@ -119,11 +119,17 @@ public final class SchemaBuilder { entities: inout [ NSEntityDescription ]) { // Note: This is called recursively - var allFrozen = false + var allFrozen = true // Create the basic entity and property data for modelType in modelTypes { - guard !isFrozen(modelType) else { continue } + if isFrozen(modelType) { + if let entity = lookupEntity(modelType) { + entities.append(entity) + continue + } + assertionFailure("Type frozen, but no entity found?") + } allFrozen = false if let newEntity = processModel(modelType) { entities.append(newEntity)