Error with param of type Date since 4.0.2 #144

Closed
opened 2025-12-29 15:25:27 +01:00 by adam · 2 comments
Owner

Originally created by @ThibaultVlacich on GitHub (Jun 2, 2017).

I have this error since 4.0.2:

Cannot invoke value of type ValueContainer<Article>.Required<Date>.Type with argument list (String)

Here's the related part of the code:

import CoreStore

class Article: CoreStoreObject {
    
    let date = Value.Required<Date>("date")

}

Was working perfectly before. I can't explain why is that by looking at the changes.

Originally created by @ThibaultVlacich on GitHub (Jun 2, 2017). I have this error since 4.0.2: > Cannot invoke value of type `ValueContainer<Article>.Required<Date>.Type` with argument list `(String)` Here's the related part of the code: ```swift import CoreStore class Article: CoreStoreObject { let date = Value.Required<Date>("date") } ``` Was working perfectly before. I can't explain why is that by looking at the changes.
adam closed this issue 2025-12-29 15:25:27 +01:00
Author
Owner

@JohnEstropia commented on GitHub (Jun 2, 2017):

The fix here https://github.com/JohnEstropia/CoreStore/issues/169 included a change that removed non-intuitive defaults for Date, URL, UUID, etc. For these types you'll need to provide a default argument:

let date = Value.Required<Date>("date", default: Date.distantPast)

Or you can just use Value.Optional<Date>.

@JohnEstropia commented on GitHub (Jun 2, 2017): The fix here https://github.com/JohnEstropia/CoreStore/issues/169 included a change that removed non-intuitive defaults for Date, URL, UUID, etc. For these types you'll need to provide a `default` argument: ```swift let date = Value.Required<Date>("date", default: Date.distantPast) ``` Or you can just use `Value.Optional<Date>`.
Author
Owner

@ThibaultVlacich commented on GitHub (Jun 2, 2017):

Oh, so it's linked to this fix. I thought it was working with 4.0.1 but I might be wrong, that's why I didn't make the connection.

@ThibaultVlacich commented on GitHub (Jun 2, 2017): Oh, so it's linked to this fix. I thought it was working with 4.0.1 but I might be wrong, that's why I didn't make the connection.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/CoreStore#144