You can use asserts: 
    
    
    let b: byte = 42'u8
    let c = 42'u16
    proc test*[T](t: T): bool =
      assert(sizeof(T) == 1, "invalid parameter size: " & $sizeof(T))
      result = true
    echo test(b)
    echo test(c)
    

Reply via email to