Closed nanakura closed 1 month ago
List(Str) Union types does not implement the Iterable trait
os = pyimport "os" d = os.getcwd!() for! os.walk!(d), [root, dirs, files] => print! root, dirs, files filtered_d = dirs.iter().filter(i -> i == "").to_list() print! filtered_d
compile success
🚫 Error[#2388]: File test3.er, line 6, <module>::<lambda_5>::filtered_d 6 │ filtered_d = dirs.iter().filter(i -> i == "").to_list() · ---- TypeError: Str or List(Str, _: Nat) does not implement Iterable(Str)
D:\workspace\erg\demo1>erg --version Erg 0.6.36
0.6.36
Python3.11
Windows 11
Describe the bug?
List(Str) Union types does not implement the Iterable trait
Reproducible code
Expected result
compile success
Actual result
Additional context
D:\workspace\erg\demo1>erg --version Erg 0.6.36
Erg version
0.6.36
Python version
Python3.11
OS
Windows 11