From bed752fcc8a54d0e39e897bbde9fa90ccd662c39 Mon Sep 17 00:00:00 2001 From: Saem Ghani Date: Thu, 26 Oct 2023 14:19:41 -0700 Subject: [PATCH] initial test case for follow-on issue --- tests/lang_callable/overload/tfoo.nim | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/lang_callable/overload/tfoo.nim diff --git a/tests/lang_callable/overload/tfoo.nim b/tests/lang_callable/overload/tfoo.nim new file mode 100644 index 00000000000..74fe89047e4 --- /dev/null +++ b/tests/lang_callable/overload/tfoo.nim @@ -0,0 +1,29 @@ +discard """ +""" + +import std/strformat + +echo fmt"{1}f" + +#[ +# attempting at creating a minimal failure case +proc main(n: SomeNumber) = + when n is SomeUnsignedInt: + var v = n.uint64 + let negative = false + else: + let n = n.int64 + let negative = n < 0 + var v = + if negative: + # `uint64(-n)`, but accounts for `n == low(int64)` + uint64(not n) + 1 + else: + uint64(n) + + var w = typeof(v)(10) + + doAssert v == w + +main(10) +]# \ No newline at end of file