member visibility is too strict for object creation expressions
class Foo {
int bar; // private/protected - same issue
Foo copy () {
return new Foo () { bar = bar };
}
Foo copy2 () {
var f = new Foo ();
f.bar = bar;
return f;
}
}
oce-access.vala:5.29-5.37: error: Access to private member `Foo.bar' denied
5 | return new Foo () { bar = bar };
| ^~~~~~~~~
Compilation failed: 1 error(s), 0 warning(s)
but bar
is accessible