class Foo { public G prop { get; private set; } public Foo (G g) { prop = g; } } void main() { var foo = new Foo (23); assert (foo.prop == 23); }