teal-language / tl

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

New varargs style is broken when penultimate type is the same as the varargs type #679

Closed 13k closed 1 year ago

13k commented 1 year ago

It also breaks old style varargs.

local f: function(x: number, s: string, string...): boolean
local g: function(x: number, s: string, ...: string): boolean
> tl check fn-vararg.tl
========================================
2 syntax errors:
fn-vararg.tl:1:51: '...' can only be last argument
fn-vararg.tl:2:53: '...' can only be last argument
hishamhm commented 1 year ago

Thank you for the report and testcase! It's now fixed!