- Subscripting of constant slices would sometimes be considered non-constant #2635.

This commit is contained in:
Christoffer Lerno
2025-12-10 14:11:51 +01:00
parent 3a8a6aa429
commit 1fc522ec9c
4 changed files with 28 additions and 4 deletions

View File

@@ -0,0 +1,24 @@
module test;
import std;
struct OfStruct
{
int type;
}
struct IContainAnArrayOfStructs
{
OfStruct[] array;
}
macro reproduce(OfStruct[] $self)
{
var a = $self;
var b = $self[0];
}
fn int main(String[] args)
{
reproduce({{1},{2},{3}});
return 0;
}