On Fri, 27 Jul 2012 16:39:49 +0200, Namespace <rswhi...@googlemail.com> wrote:

What's wrong with the solution that

void some_function(Foo? f) {

is converted to

void some_function(Foo f, string filename = __FILE__, uint line = __LINE__) in { assert(f !is null, std.string.format("Null Object @ File %s on Line %d.", filename, line));
} body {

? It isn't a huge effort for the compiler, or?

Nope.

But, that's just a simple assertion. If we'd had real non-nullable types,
we could remove the check completely, because you'd know it held a valid
object.

Now, a library solution has certain limitations a built-in solution would
not - for instance, new X would return non-nullable.

--
Simen

Reply via email to