teal-language / tl

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

Missing separator argument for string.rep #593

Closed CoolingTool closed 1 year ago

CoolingTool commented 1 year ago

https://www.lua.org/manual/5.4/manual.html#pdf-string.rep image

as you can tell i don't know how to write issues

icy-lava commented 1 year ago

I see the problem is here: https://github.com/teal-language/tl/blob/e4639a40a414ce670b06ff724335b689ad4a4177/tl.tl#L5474

I could try and fix it, but the problem is that the third arg doesn't exist in lua 5.1 (it does exist in 5.2+ and luajit).

@hishamhm is there a way I could define it conditionally based on the version?

hishamhm commented 1 year ago

Compat-5.3 can provide the third argument, so it should be ok to enable it unconditionally, triggering the compat glue code like we do for some other functions.

Message ID: @.***>