diff options
author | Bung <crc32@qq.com> | 2023-08-10 16:26:23 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-10 16:26:23 +0800 |
commit | 2aab03bdfb0a216820541de7dcb34950a017bf18 (patch) | |
tree | c5115a8fa6f5b3c2a09df3de4925e0d0d2b8c670 /tests/stdlib | |
parent | a6610745d80c56b531eab05341f056c87129df72 (diff) | |
download | Nim-2aab03bdfb0a216820541de7dcb34950a017bf18.tar.gz |
fix #19304 Borrowing std/times.format causes Error: illformed AST (#20659)
* fix #19304 Borrowing std/times.format causes Error: illformed AST * follow suggestions * mitigate for #4121 * improve error message
Diffstat (limited to 'tests/stdlib')
-rw-r--r-- | tests/stdlib/t19304.nim | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/stdlib/t19304.nim b/tests/stdlib/t19304.nim new file mode 100644 index 000000000..5e8795ac5 --- /dev/null +++ b/tests/stdlib/t19304.nim @@ -0,0 +1,7 @@ +import times + +type DjangoDateTime* = distinct DateTime + +# proc toTime*(x: DjangoDateTime): Time {.borrow.} # <-- works +proc format*(x: DjangoDateTime, f: TimeFormat, + loc: DateTimeLocale = DefaultLocale): string {.borrow.} |