teal-language / tl

The compiler for Teal, a typed dialect of Lua
MIT License
2.03k stars 101 forks source link

fix utf8.codes signature #696

Closed fperrad closed 9 months ago

fperrad commented 10 months ago

the iterator returned by utf8.codes needs some arguments (when called outside a for loop)

$ cat codes.lua
local s = "foo"
local iter = utf8.codes(s)
print(iter(s))
print(iter(s, 1))
$ ./tl run codes.lua
1   102
2   111
$ ./tl check codes.lua
========================================
2 errors:
codes.lua:3:11: wrong number of arguments (given 1, expects 0)
codes.lua:4:11: wrong number of arguments (given 2, expects 0)
github-actions[bot] commented 10 months ago

Teal Playground URL: https://696--teal-playground-preview.netlify.app

hishamhm commented 9 months ago

Thanks!!