[PR #387] [CLOSED] Allow nil default values for stored attributes #499

Closed
opened 2025-12-29 15:32:42 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/JohnEstropia/CoreStore/pull/387
Author: @Saklad5
Created: 5/14/2020
Status: Closed

Base: developHead: develop


📝 Commits (1)

  • 69626b0 Allow 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-nil value.

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.

## 📋 Pull Request Information **Original PR:** https://github.com/JohnEstropia/CoreStore/pull/387 **Author:** [@Saklad5](https://github.com/Saklad5) **Created:** 5/14/2020 **Status:** ❌ Closed **Base:** `develop` ← **Head:** `develop` --- ### 📝 Commits (1) - [`69626b0`](https://github.com/JohnEstropia/CoreStore/commit/69626b0e5d1d88a6f0ee5943dfbc66330bc95cf2) Allow nil default values for stored attributes ### 📊 Changes **1 file changed** (+24 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `Sources/Field.Stored.swift` (+24 -2) </details> ### 📄 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-`nil` value. This change should increment the minor version number. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 15:32:42 +01:00
adam closed this issue 2025-12-29 15:32:42 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore#499