mirror of
https://github.com/JohnEstropia/CoreStore.git
synced 2026-01-11 20:00:30 +01:00
[PR #387] [CLOSED] Allow nil default values for stored attributes #499
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/387
Author: @Saklad5
Created: 5/14/2020
Status: ❌ Closed
Base:
develop← Head:develop📝 Commits (1)
69626b0Allow nil default values for stored attributes📊 Changes
1 file changed (+24 additions, -2 deletions)
View changed files
📝
Sources/Field.Stored.swift(+24 -2)📄 Description
Core Data does not require default values for attributes. For the sake of model compatibility, CoreStore should not either.
This change is purely additive: it allows nil values to be (explicitly) provided as the initial value of properties wrapped with Field.Stored.
In theory, the only thing necessary to make this change is allowing an optional
wrappedValue. In practice, that seems to produce an uncaught compilation error if you use assignment syntax to initialize a wrapped value with a non-nilvalue.This change should increment the minor version number.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.