mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-12 06:18:51 +00:00
24 lines
498 B
Nim
24 lines
498 B
Nim
discard """
|
|
matrix: "--hintaserror:ConvFromXtoItselfNotNeeded"
|
|
"""
|
|
|
|
# bug #10542
|
|
|
|
proc f(args: varargs[string, string], length: int) =
|
|
doAssert args.len == length
|
|
|
|
# main use case that requires type conversion (no warning here)
|
|
f("a", "b", 2)
|
|
f("a", 1)
|
|
|
|
|
|
proc m(args: varargs[cstring, cstring]) =
|
|
doAssert args.len == 2
|
|
|
|
# main use case that requires type conversion (no warning here)
|
|
m("a", "b")
|
|
|
|
# if an argument already is cstring there's a warning
|
|
let x: cstring = "x"
|
|
m("a", x)
|
|
m(x, "a") |