t10542.nim 498 B

123456789101112131415161718192021222324
  1. discard """
  2. matrix: "--hintaserror:ConvFromXtoItselfNotNeeded"
  3. """
  4. # bug #10542
  5. proc f(args: varargs[string, string], length: int) =
  6. doAssert args.len == length
  7. # main use case that requires type conversion (no warning here)
  8. f("a", "b", 2)
  9. f("a", 1)
  10. proc m(args: varargs[cstring, cstring]) =
  11. doAssert args.len == 2
  12. # main use case that requires type conversion (no warning here)
  13. m("a", "b")
  14. # if an argument already is cstring there's a warning
  15. let x: cstring = "x"
  16. m("a", x)
  17. m(x, "a")