type inference num literals
Currently the type of numeric literals can be inferred based on its assignment to be one of the supported primitives, e.g. u8, ..., i64 etc. Maybe it makes sense to generalize this to features that take exactly one argument that is of a supported type.
An example:
ex =>
wait(a ms) is
ms(val u64) is
three_ms ms := ms 3
wait (ms 3)
three_ms ms := 3 # does currently not work
wait 3 # does currently not work
I have a hard time wrapping my head around this idea, I don't see why this should work.
@maxteufel It should work similar as type inference for e.g. i32(val i32) is
We may have to wrap the numliteral and generate a call to the feature e.g. for wait ms / wait 3 will be turned into wait (ms 3)
My comment was perhaps not written well, what I meant is that I don't see the point for this. It sure is syntax sugar for less typing, but I don't see how it makes sense from a programming language standpoint.