-
Notifications
You must be signed in to change notification settings - Fork 172
Closed
Labels
cLabel for C language related changesLabel for C language related changeshigh priorityThe issue is blocking other projects, not easy to workaround, must be fixed as soon as possibleThe issue is blocking other projects, not easy to workaround, must be fixed as soon as possible
Description
Example:
from ltypes import f64
def f() -> f64:
return 5.5
def main():
t1: f64 = f()*1e6
print(t1)
main()This generates:
$ lpython --show-c a.py
...
void _xx_lcompilers_changed_main_xx()
{
double t1 = f()* 1.00000000000000000e+06;
t1 = f()* 1.00000000000000000e+06;
printf("%lf\n", t1);
}
...Which is wrong, it should only be initialized once.
Metadata
Metadata
Assignees
Labels
cLabel for C language related changesLabel for C language related changeshigh priorityThe issue is blocking other projects, not easy to workaround, must be fixed as soon as possibleThe issue is blocking other projects, not easy to workaround, must be fixed as soon as possible