Skip to content

Commit cc531fc

Browse files
committed
Make the fields of times.DateTime private
1 parent 3e060cf commit cc531fc

File tree

4 files changed

+218
-88
lines changed

4 files changed

+218
-88
lines changed

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@
7676
7777
proc foo(x: int, y: int): auto {.noSideEffect.} = x + y
7878
```
79+
- The fields of `times.DateTime` are now private, and are accessed with getters and deprecated setters.
80+
81+
- The `times` module now handles the default value for `DateTime` more consistently. Most procs raise an assertion error when given
82+
an uninitialized `DateTime`, the exceptions are `==` and `$` (which returns `"Uninitialized DateTime"`). The proc `times.isInitialized`
83+
has been added which can be used to check if a `DateTime` has been initialized.
7984

8085
## Language changes
8186
- In newruntime it is now allowed to assign discriminator field without restrictions as long as case object doesn't have custom destructor. Discriminator value doesn't have to be a constant either. If you have custom destructor for case object and you do want to freely assign discriminator fields, it is recommended to refactor object into 2 objects like this:

0 commit comments

Comments
 (0)