Files
c3c/test/test_suite/compile_time/concat_slice_array.c3
Christoffer Lerno abe4727c3a Deprecate uXX and iXX bit suffixes.
Add experimental LL / ULL suffixes for int128 and uint128 literals.
2025-05-13 23:48:59 +02:00

16 lines
441 B
Plaintext

module test;
const BITS = 8;
fn int main()
{
String $chars = "Abcd";
char $from = 2;
char[10] $bitmap = {};
$foreach $c : $chars:
int $offset = ($c - $from) / BITS;
int $rem = ($c - $from) % BITS;
uint128 $value = $bitmap[$offset]; // #error: is out of range
$value |= 1ULL << $rem;
$bitmap = $bitmap[:$offset] +++ $value +++ $bitmap[$offset+1..]; // #error: End index out of bounds
$endforeach
}