Optional!int foo = 7; foo.match!( (int value) => true, () => false ); // true
immutable Optional!int foo = 7; immutable Optional!int bar; // dfmt off assertTrue(foo.match!( (int value) => true, () => false )); assertFalse(bar.match!( (int value) => true, () => false )); // dfmt on
immutable Nullable!int foo = 7; immutable Nullable!int bar; // dfmt off assertTrue(foo.match!( (int value) => true, () => false )); assertFalse(bar.match!( (int value) => true, () => false )); // dfmt on
Pattern matching for Nullable and Optional types