Closed
Description
Test Case 1 (dict_string.py
):
def fun():
y : dict[str, i32]
y = {"apple": 1}
print(y["apple"])
fun()
- Normal Python Output:
1
- LPython Output (when
inst\bin\lpython examples/dict_string.py
was executed
# NO OUTPUT WITNESSED.
Unknown behavior of print statement was observed. Without throwing any error or warning, the program just terminates abruptly for me.
Test Case 2 (dict_string.py
)
def fun():
x : dict[i32, i32] = {1: 2}
print(x[1])
y : dict[str, i32]
y = {"apple": 1}
print(y["apple"])
fun()
- Normal Python Output:
2
1
- LPython Output (when
inst\bin\lpython examples/dict_string.py
was executed
code generation error: Variable type not supported 12
--> examples/dict_string.py:5:5
|
5 | y : dict[str, i32]
| ^^^^^^^^^^^^^^^^^^
Does the dictionary has support for string data types yet or not?
@czgdp1807 @Thirumalai-Shaktivel