nimpy icon indicating copy to clipboard operation
nimpy copied to clipboard

Support for more than one argument type

Open qb-0 opened this issue 2 years ago • 0 comments

import nimpy

proc foo(a: int|string) {.exportpy.} =
  when type(a) is int:
    echo "Got int"
  elif type(a) is string:
    echo "Got string"

foo(100)
foo("Hello")

Fails currently with invalid type: 'void' for var

qb-0 avatar Mar 09 '22 19:03 qb-0