improvements to addInt and $ for integer types (#18592)
* improvements to $(SomeInteger) and addInt * remove mIntToStr, mInt64ToStr * improvements * fix tests/pragmas/tinjectstmt.nim; the diff is harmless, cgen code is identical with -d:danger or debug mode * rm tests/system/tstrmantle.nim * revert compiler/jsgen.nim for -d:nimVersion140
This commit is contained in:
parent
7b58dc2de0
commit
394f4ac7bb
12 changed files with 162 additions and 186 deletions
|
|
@ -12,7 +12,6 @@ import std/private/miscdollars
|
|||
|
||||
type InstantiationInfo = tuple[filename: string, line: int, column: int]
|
||||
|
||||
proc `$`(x: int): string {.magic: "IntToStr", noSideEffect.}
|
||||
proc `$`(info: InstantiationInfo): string =
|
||||
# The +1 is needed here
|
||||
# instead of overriding `$` (and changing its meaning), consider explicit name.
|
||||
|
|
@ -108,7 +107,9 @@ template doAssertRaises*(exception: typedesc, code: untyped) =
|
|||
wrong = true
|
||||
except exception:
|
||||
discard
|
||||
except Exception as e: raiseAssert(begin & " raised '" & $e.name & "'" & msgEnd)
|
||||
except Exception as e:
|
||||
mixin `$` # alternatively, we could define $cstring in this module
|
||||
raiseAssert(begin & " raised '" & $e.name & "'" & msgEnd)
|
||||
except: raisedForeign()
|
||||
if wrong:
|
||||
raiseAssert(begin & " nothing was raised" & msgEnd)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue