[BUG] Predict type in print
Math-O5 opened this issue · comments
Mathias Fernandes Duarte Coelho commented
Describe the bug
When print is used inside a function, the type is not defined yet, so it will throw a error.
Steps to Reproduce
in Sim-C:
fun sum(a) {
print(a)
}
fun sum(a, b) {
print(a + b)
}
Expected behavior
Process the prediction type in compiler time, because only then the variable will be defined. If not defined yet, then throw an error.
Siddhartha Dhar Choudhury commented
Also fixed a minor bug in var_statement parser, see #487 for details.