On Sun, 19 Aug 2012 22:18:37 +0200, Walter Bright
<newshou...@digitalmars.com> wrote:
On 8/19/2012 5:08 AM, bearophile wrote:
With a different type system the compiler makes sure at compile-time
that x is
not empty (this means the compiler makes sure in no code paths x is
used before
testing it contains something), avoiding the run-time exception.
That's called disabling the default constructor with @disable.
Nope. What bearophile is talking about is something more akin to this,
I think:
Nullable!int a;
int x = a; // Compile-time error: a might be null!
if ( a ) {
int y = a; // 's fine, we know it's not null.
}
--
Simen