6 public class Sample : Object {
7 private string automatic { get; set; }
12 set { _name = value; }
15 private string _read_only;
16 public string read_only {
17 get { return _read_only; }
20 public Sample (string name) {
25 _automatic = "InitialAutomatic";
26 _read_only = "InitialReadOnly";
31 stdout.printf("property `%s' has changed!\n",
36 automatic = "TheNewAutomatic";
39 // The following statement would be rejected
40 // read_only = "TheNewReadOnly";
42 stdout.printf("automatic: %s\n", automatic);
43 stdout.printf("name: %s\n", name);
44 stdout.printf("read_only: %s\n", read_only);
45 stdout.printf("automatic: %s\n", automatic);
48 static int main (string[] args) {
49 var test = new Sample("InitialName");
55 stdout.printf ("Interface Properties Test: 1");
57 Maman.Ibaz ibaz = new Maman.Baz ();
58 ibaz.simple_method ();
60 stdout.printf (" 3\n");
66 abstract class Maman.Foo : Object {
67 private int _public_base_property = 2;
68 public int public_base_property {
70 return _public_base_property;
73 _public_base_property = value;
76 public abstract int abstract_base_property { get; set; }
79 class Maman.Bar : Foo {
80 public int public_property { get; set; default = 3; }
81 public override int abstract_base_property { get; set; }
84 stdout.printf (" %d %d", public_base_property, public_property);
85 public_base_property = 4;
87 stdout.printf (" %d %d", public_base_property, public_property);
90 public static void run () {
91 stdout.printf ("Property Test: 1");
97 foo.abstract_base_property = 6;
98 stdout.printf (" %d", foo.abstract_base_property);
100 stdout.printf (" 7\n");
104 interface Maman.Ibaz : Object {
105 public abstract int number { get; }
107 public void simple_method () {
109 stdout.printf (" %d", n);
113 class Maman.Baz : Object, Ibaz {