New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can not use nim 2's new default instantiation with any object type with a distinct DateTime
field
#20695
Comments
I got another simpler related cases, I will open a separate issue. import times
proc foo(x: static DateTime = Datetime()) =
discard It fails at 1.6.8 |
This was referenced Nov 3, 2022
ringabout
added a commit
that referenced
this issue
Feb 23, 2023
Araq
pushed a commit
that referenced
this issue
Feb 24, 2023
survivorm
pushed a commit
to survivorm/Nim
that referenced
this issue
Feb 28, 2023
capocasa
pushed a commit
to capocasa/Nim
that referenced
this issue
Mar 31, 2023
bung87
pushed a commit
to bung87/Nim
that referenced
this issue
Jul 29, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What happened?
Related issue that fixes a more fundamental version of this problem: #20681
This is basically a more specialized version/an edgecase of that very same issue, so I'll copy the initial description:
It is currently impossible to instantiate a
distinct DateTime
object at compile time. That makes it difficult to make use of nim 2's new feature of #20480 for any object with fields of a custom version of the DateTime type.My original minimal example:
@ringabout narrowed down the issue more specifically to be
Nim Version
Nim Compiler Version 1.7.3 [Linux: amd64]
Compiled at 2022-10-29
Copyright (c) 2006-2022 by Andreas Rumpf
git hash: 534c97e
active boot switches: -d:release
However, I've been told by @ringabout that the issue in his example is more fundamental and replicable in older nim versions as well
Current Standard Output Logs
Expected Standard Output Logs
Possible Solution
This problem is absolutely beyond me, no idea.
Additional Information
No response
The text was updated successfully, but these errors were encountered: