`console.log` not variadic
Closed this issue · 2 comments
Checking
console.log("a", "b")
Yields an excess argument error.
But, console.log() is variadic though, so I would want this to work.
I'd be happy to work on this, but I'm not sure how builtin function declarations are handled.
Hey, that is correct and a bug!
Rest parameters / variadic functions and calling them has been implemented / is currently supported
- https://github.com/kaleidawave/ezno/blob/main/checker/specification/specification.md#arguments-in-to-rest-parameter
- https://github.com/kaleidawave/ezno/blob/main/checker/specification/specification.md#type-of-rest-parameter
You can see the calling implementation here
ezno/checker/src/types/calling.rs
Line 1141 in 24e35b9
The issue is currently because Console
is typed incorrectly:
ezno/checker/definitions/overrides.d.ts
Lines 167 to 172 in 24e35b9
I think
console.log
was one of the first functions I added checking for and it was only a while later I added variadic functions. And thus I must have missed updating the definition
This is similar to #118 issue (which I left a comment on the status of reusing TypeScripts lib.d.ts
definition). I have opened #121 which describes how I want to implement it (although it is not quite ready / waiting on some other things).
Unsure whether I should start doing #121 manually or wait for more checking features to be implemented 🤷♂️