Take for example this function:
fn add a b {
return a+b;
}
We can pass literally anything to it, and that's a problem
We can implement type hints like this:
fn add a: num b: num {
return a + b;
}
The function call will error out if the arguments don't match the expected types
We can also take advantage of a special dictionary field called '_typename'. Then we can also pass a Result struct to something:
Take for example this function:
We can pass literally anything to it, and that's a problem
We can implement type hints like this:
The function call will error out if the arguments don't match the expected types
We can also take advantage of a special dictionary field called '_typename'. Then we can also pass a Result struct to something: