You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import std/strformat
procexec(cmd: string, args: varargs[string]) =let x =@[cmd] & args
raisenewException(CatchableError):
fmt"{x}"# Only referring to a "broken" variable would this issue happen
Actual Output
test.nim(5, 3) Error: only a 'ref object' can be raised
Expected Output
The real cause of the error (invalid expression for x) should show up instead
test.nim(4, 18) Error: type mismatch: got <seq[string], varargs[string]>
but expected one of:
proc `&`[T](x, y: seq[T]): seq[T]
first type mismatch at position: 2
required type for y: seq[T]
but expression 'args' is of type: varargs[string]
proc `&`[T](x: T; y: seq[T]): seq[T]
first type mismatch at position: 2
required type for y: seq[T]
but expression 'args' is of type: varargs[string]
proc `&`[T](x: seq[T]; y: T): seq[T]
first type mismatch at position: 2
required type for y: T
but expression 'args' is of type: varargs[string]
5 other mismatching symbols have been suppressed; compile with --showAllMismatches:on to see them
expression: @[cmd] & args
Additional information
Mainline does not have this issue
The text was updated successfully, but these errors were encountered:
Error report order issue with --errorMax:0 the error is there just not presented first
/home/jason/nimskull/bin/abuse.nim(5, 3) Error: only a 'ref object' can be raised
/home/jason/nimskull/bin/abuse.nim(4, 18) Error: type mismatch: got <seq[string], varargs[string]>
but expected one of:
proc `&`[T](x, y: seq[T]): seq[T]
first type mismatch at position: 2
required type for y: seq[T]
but expression 'args' is of type: varargs[string]
proc `&`[T](x: T; y: seq[T]): seq[T]
first type mismatch at position: 2
required type for y: seq[T]
but expression 'args' is of type: varargs[string]
proc `&`[T](x: seq[T]; y: T): seq[T]
first type mismatch at position: 2
required type for y: T
but expression 'args' is of type: varargs[string]
5 other mismatching symbols have been suppressed; compile with --showAllMismatches:on to see them
## Summary
Fix errors in expressions within `raise` statements being hidden
behind an "only a 'ref object' can be raised" error.
Fixes#112
## Details
* make `semRaise` `nkError`-aware (proper error propagation)
* don't modify input AST in `semRaise`
* replace `localReport` in `semRaise` with `nkError`; the necessary
diagnostics corresponding to the legacy reports are introduced
Example
Actual Output
Expected Output
The real cause of the error (invalid expression for
x
) should show up insteadAdditional information
The text was updated successfully, but these errors were encountered: