mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-06 04:57:49 +00:00
fix off by 1 error in col shown by toFileLineCol (#10138)
* fix off by 1 error in `col` shown by toFileLineCol * fix test failures
This commit is contained in:
committed by
Andreas Rumpf
parent
7ac1fc81fd
commit
ab72d68ec8
@@ -208,7 +208,7 @@ proc toFileLine*(conf: ConfigRef; info: TLineInfo): string {.inline.} =
|
||||
result = toFilename(conf, info) & ":" & $info.line
|
||||
|
||||
proc toFileLineCol*(conf: ConfigRef; info: TLineInfo): string {.inline.} =
|
||||
result = toFilename(conf, info) & "(" & $info.line & ", " & $info.col & ")"
|
||||
result = toFilename(conf, info) & "(" & $info.line & ", " & $(info.col+1) & ")"
|
||||
|
||||
proc `$`*(conf: ConfigRef; info: TLineInfo): string = toFileLineCol(conf, info)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
errormsg: '''expression 'open(f, "arg.txt", fmRead, -1)' is of type 'bool' and has to be discarded; start of expression here: tneedsdiscard.nim(7, 2)'''
|
||||
errormsg: '''expression 'open(f, "arg.txt", fmRead, -1)' is of type 'bool' and has to be discarded; start of expression here: tneedsdiscard.nim(7, 3)'''
|
||||
line: 10
|
||||
"""
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
errormsg: "invalid declaration order; cannot attach 'step' to method defined here: tmapper.nim(22, 7)"
|
||||
errormsg: "invalid declaration order; cannot attach 'step' to method defined here: tmapper.nim(22, 8)"
|
||||
line: 25
|
||||
"""
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
discard """
|
||||
errormsg: "public implementation 'tmismatchedvisibility.foo(a: int)[declared in tmismatchedvisibility.nim(6, 5)]' has non-public forward declaration in "
|
||||
errormsg: "public implementation 'tmismatchedvisibility.foo(a: int)[declared in tmismatchedvisibility.nim(6, 6)]' has non-public forward declaration in "
|
||||
line: 8
|
||||
"""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user