mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
[PR #191] [MERGED] Corrected type-checking in fetchExisting to preserve input type #473
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/JohnEstropia/CoreStore/pull/191
Author: @sidmani
Created: 8/16/2017
Status: ✅ Merged
Merged: 8/16/2017
Merged by: @JohnEstropia
Base:
prototype/Swift_4_0← Head:prototype/Swift_4_0📝 Commits (1)
c89bc3cCorrected type-checking in fetchExisting to preserve input type📊 Changes
1 file changed (+3 additions, -1 deletions)
View changed files
📝
Sources/NSManagedObjectContext+Querying.swift(+3 -1)📄 Description
Turns out the problem in #190 was very simple to fix- instead of using T, the type of the object passed to fetchExisting, use type(of:) to get the dynamic type at runtime and properly instantiate the result. The change shouldn't affect any existing projects that use the method since the return type is unchanged.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.