-
Notifications
You must be signed in to change notification settings - Fork 169
Open
Description
$ cat a.py
from math import log2, floor
def ff():
i: i32
for i in range(1, 1000):
x: i32
x = i
y: f32
y = float(x)
assert x.bit_length() == floor(log2(y)) + 1
for i in range((1 << 30), (1 << 30) + 100 , 2):
x: i32
x = i
y: f32
y = float(x)
assert x.bit_length() == floor(log2(y)) + 1
ff()
result:
$ ./src/bin/lpython -o out a.py
semantic error: Symbol is already declared in the same scope
--> a.py:5:9
|
5 | x: i32
| ~~~~~~ original declaration
|
12 | x: i32
| ^^^^^^ redeclaration
Note: if any of the above error or warning messages are not clear or are lacking
context please report it to us (we consider that a bug that needs to be fixed).
Metadata
Metadata
Assignees
Labels
No labels