c3c icon indicating copy to clipboard operation
c3c copied to clipboard

Reference parameter doesn't work with vector subscript

Open cbuttner opened this issue 1 year ago • 1 comments

fn void main() {
  int[4] array;
  @foo(array[0]);
  assert(array[0] == 1);

  int[<4>] vec;
  @foo(vec[0]);
  assert(vec[0] == 1); // This assert fails
}

macro @foo(&ref) {
  *ref += 1;
}

cbuttner avatar Jul 23 '24 16:07 cbuttner

Thanks, an important bug to fix. I put it in 0.6.1.

lerno avatar Jul 23 '24 21:07 lerno

It's fixed, thanks.

cbuttner avatar Aug 03 '24 20:08 cbuttner