davedelong / time

Robust and type-safe date and time calculations for Swift
MIT License
2.32k stars 77 forks source link

Stack overflow (?) when calling `firstInstant` #37

Closed jdmcd closed 4 years ago

jdmcd commented 4 years ago

I have the following code:

let utc = Clock.system.converting(to: TimeZone(identifier: "UTC")!).thisMinute()
let plusFiveMinutes = (utc + .minutes(5)).firstInstant.date

Running it causes the following error to be thrown in Xcode:

Screen Shot 2020-03-22 at 6 18 09 PM

(Nothing useful in the console, blocked out because it had sensitive API routes)

Any ideas here? It looks like some kind of possible recursion or stack overflow bug because the entire stack is filled with the two same calls (Value.range.getter and Value.approximateMidPoint.getter) but not positive.

Let me know if there's anything I can do to help debug.

davedelong commented 4 years ago

Yep, this is a duplicate of #19 and is fixed on master.

Thanks for reporting! :)

jdmcd commented 4 years ago

Got it, thanks! Will target master instead of the tagged version. Appreciate it!