Here you go
    
    
    const allowedInts = {1, 3, 5, 8}
    
    proc foo(bar:static[int]) =
      static: assert bar in allowedInts, "Value " & $bar & " not allowed"
      echo "Success"
    
    foo(6)
    
    
    
    const allowedInts = {1, 3, 5, 8}
    
    proc foo(bar:static[int]) =
      static: assert bar in allowedInts, "Value " & $bar & " not allowed"
      echo "Success"
    
    foo(5)
    

Reply via email to