- Bitstruct accidentally allowed other arrays than char arrays #2836

This commit is contained in:
Christoffer Lerno
2026-01-25 12:14:34 +01:00
parent 8bd942c1b8
commit cf9784afee
5 changed files with 16 additions and 6 deletions

View File

@@ -1,3 +1,3 @@
bitstruct Foo : FixedBlockPool // #error: The type of the bitstruct cannot be 'FixedBlockPool' but must be an integer or an array of integers
bitstruct Foo : FixedBlockPool // #error: The type of the bitstruct cannot be 'FixedBlockPool' but must be an integer
{
}

View File

@@ -0,0 +1,10 @@
bitstruct Foo2 : int[2] // #error: The type of the bitstruct cannot be 'int[2]' but must be an
{
bool enable_version;
}
fn void main()
{
Foo2 a2 = { };
Foo2 b2 = { .enable_version, };
if (!(a2 & b2)) return;
}

View File

@@ -1,5 +1,5 @@
bitstruct Test : float // #error: The type of the bitstruct cannot be 'float' but must be an integer or an array of integers.
bitstruct Test : float // #error: The type of the bitstruct cannot be 'float' but must be an integer
{
int a : 1..3;
int b : 5..10;