mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
* fix #10053 FieldError for vm * fixup * FieldError now also shows runtime value of discriminant * fix field error reporting in vm * also report culprit line info in err msg * fix errors for newruntime 2 * fix for js * fixup * PRTEMP4 * works * works * works perfect * refactor * std/private/repr_impl * suppport --gc:arc * cleanup * refactor * simplify * simplify * simplify * fixup * move out compiler.vmgen.genCustom * fixup * fixup * add tests * revert compiler/debugutils.nim * simplify reprDiscriminant * fixup * lib/std/private/repr_impl.nim -> lib/system/repr_impl.nim * try to fix D20210812T165220 * honor --declaredlocs * control toFileLineCol via --declaredlocs
16 lines
531 B
Nim
16 lines
531 B
Nim
# imported by other modules, unlike helpers.nim which is included
|
|
# xxx this is now included instead of imported, we should import instead
|
|
|
|
template formatErrorIndexBound*[T](i, a, b: T): string =
|
|
when defined(standalone):
|
|
"indexOutOfBounds"
|
|
else:
|
|
if b < a: "index out of bounds, the container is empty"
|
|
else: "index " & $i & " not in " & $a & " .. " & $b
|
|
|
|
template formatErrorIndexBound*[T](i, n: T): string =
|
|
formatErrorIndexBound(i, 0, n)
|
|
|
|
template formatFieldDefect*(f, discVal): string =
|
|
f & discVal & "'"
|