CGRect.size().setWidth(width) doesn't update width

Hi, I’m trying to update CGRect width. So, when I do something like this:

  public double updateWidth(double width) {
    CGRect r = new CGRect();
    r.size().setWidth(width);
    return r.size().width();
  }

method returns 0.

It seems like a bug.
Right now I forced to use extra setSize():

public double updateWidth(double width) {
    CGSize size = rect.size();
    size.setWidth(width);
    rect.setSize(size);
    return r.size().width();
}

It seems like this is because of @ByRef.
And so that r.size() returns a copy.

Actually size() is marked with @ByValue, and that is why it is returning a copy.

We will check if it is possible to change this to @ByRef, but the memory management of struct objects is pretty complex, so it might require bigger changes.