Compiler assert with typed macro vaargs accessing a macro passed as vaarg #2498

This commit is contained in:
Christoffer Lerno
2025-09-25 14:13:06 +02:00
parent c2abbe2e2f
commit 122dbb3668
3 changed files with 21 additions and 1 deletions

View File

@@ -0,0 +1,16 @@
module test;
import std;
fn int main(String[] args)
{
test2(test1(1));
return 0;
}
macro String test1(a) => "abc";
macro test2(String...) // #error: must have a parameter name
{
$for var $i = 0; $i < $vacount; $i++:
io::printfn($vaarg[$i]);
$endfor
}