1[Compact] 2class Foo { 3 public int i; 4 5 public Foo (int i) { 6 this.i = i; 7 } 8} 9 10Foo? get_foo (int? i) { 11 return i != null ? new Foo (i) : null; 12} 13 14void main () { 15 { 16 Foo foo = get_foo (null) ?? get_foo (42); 17 assert (foo.i == 42); 18 } 19 { 20 Foo foo = get_foo (null) ?? (get_foo (null) ?? get_foo (42)); 21 assert (foo.i == 42); 22 } 23} 24