Open elimirks opened 3 years ago
To compile to LLVM or some other bytecode, we'll have to improve our inference.
For example:
def add(a, b): return (x): str(x) + "," + str(a + b) x = add(3, 7) y = x("hi") # Generate def add(a: int, b: int) -> (str -> str): z = x(3.14) # Generate def add(a: int, b: int) -> (float -> str):
In the case where a function type cannot be inferred, it's considered a no-op.
e.g.
x = add(3,7)
This expression alone doesn't do anything, because the function returned by add and assigned to x is never used.
add
x
To compile to LLVM or some other bytecode, we'll have to improve our inference.
For example:
In the case where a function type cannot be inferred, it's considered a no-op.
e.g.
This expression alone doesn't do anything, because the function returned by
add
and assigned tox
is never used.