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.
## 📋 Pull Request Information
**Original PR:** https://github.com/JohnEstropia/CoreStore/pull/191
**Author:** [@sidmani](https://github.com/sidmani)
**Created:** 8/16/2017
**Status:** ✅ Merged
**Merged:** 8/16/2017
**Merged by:** [@JohnEstropia](https://github.com/JohnEstropia)
**Base:** `prototype/Swift_4_0` ← **Head:** `prototype/Swift_4_0`
---
### 📝 Commits (1)
- [`c89bc3c`](https://github.com/JohnEstropia/CoreStore/commit/c89bc3c22712f660864ff22c469c7987c4749b0d) Corrected type-checking in fetchExisting to preserve input type
### 📊 Changes
**1 file changed** (+3 additions, -1 deletions)
<details>
<summary>View changed files</summary>
📝 `Sources/NSManagedObjectContext+Querying.swift` (+3 -1)
</details>
### 📄 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.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 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.