Allow $defined take declarations: $defined(int x = y)

Taking the address of a label would cause a crash. #2430
This commit is contained in:
Christoffer Lerno
2025-08-23 12:00:17 +02:00
parent f36e9fea48
commit e4e499edd2
16 changed files with 109 additions and 56 deletions

View File

@@ -0,0 +1,5 @@
fn int main(String[] args)
{
$defined(int a = 3.0);
$defined(int[*] b); // #error: Inferred array types can only be used in declarations
}

View File

@@ -0,0 +1,10 @@
import std;
fn int main(String[] args)
{
switch FOO: (1)
{
case 1:
io::printfn("%p", &FOO); // #error: It is not possible to take the address of a label
}
return 0;
}