mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-11-14 12:53:36 +01:00
always create subclass type from cs_rawObject
This commit is contained in:
1 parent
fa682215c5
commit
8d86425875
2 files changed
+17
-1
No files matched your search
@@ -131,7 +131,12 @@ extension CoreStoreObject {
|
||||
}
|
||||
return forceCast(coreStoreObject)
|
||||
}
|
||||
let coreStoreObject = self.init(rawObject: object)
|
||||
@inline(__always)
|
||||
func forceTypeCast<T: CoreStoreObject>(_ type: DynamicObject.Type, to: T.Type) -> T.Type {
|
||||
|
||||
return type as! T.Type
|
||||
}
|
||||
let coreStoreObject = forceTypeCast(object.entity.dynamicObjectType!, to: self).init(rawObject: object)
|
||||
object.coreStoreObject = coreStoreObject
|
||||
return coreStoreObject
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user