Closed timotheecour closed 1 year ago
NOTE: implementing https://forum.nim-lang.org/t/3750/1#23343 ([RFC] for index, name in Tup.fieldsIndexed
to get index at compile time of a tuple type) would allow circumventing this bug
if accepted, https://github.com/nim-lang/Nim/pull/7597 would allow a simple workaround
/cc @Araq
this is a reduction from a function that computes a join of tuples, or other processing on tuples; it's not a contrived example/
at runtime, gives:
Error: unhandled exception: false BUG2 [AssertionError]
when replacing
const c=(foo:(bar1:"foo1"))
byconst c=(foo:(bar1: 0.0))
, it gives CT error:Error: type mismatch: got <float64, int literal(0)>
those problems go away if we use
var tup=tup0
instead ofconst tup=tup0
those problems go away if we use
const c=(foo:(bar1: 0, bar2:0), foo2:(bar1: 0, bar2:0))
instead ofconst c=(foo:(bar1: 0.0))