GNOME Bugzilla – Bug 621787
Don't allow modifications of temporary struct values
Last modified: 2018-05-22 13:38:01 UTC
public struct Vector3 { public float x; public float y; public float z; } public class Foo { public Vector3 position { get; set; } public Foo () { } } int main (string[] args) { var f = new Foo (); // both of these compile fine in vala, // but generate c code which will not compile f.position.x++; f.position.x = 10.0f; return 0; }
This is invalid code, Vala should not allow modifications of temporary struct values. The test case actually compiles now, however, it modifies temporary variables which is probably not what you intended.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/107.