Files
c3c/test/test_suite/compile_time_introspection/defined_subscript_assign.c3
Christoffer Lerno e605a21fd3 Revert "Revert 0.7.6 code for 0.7.5 re-release"
This reverts commit d1349c9cfb.
2025-09-05 23:30:35 +02:00

14 lines
260 B
Plaintext

fn int main(String[] args)
{
MyArray a = {{1, 4, 3, 6, 5}};
$assert(!$defined(a[0] = 2));
return 0;
}
struct MyArray
{
int[] val;
}
fn int MyArray.get(self, usz idx) @operator([]) => self.val[idx];
fn usz MyArray.len(self) @operator(len) => self.val.len;