Re: [Vala] Why do regular reference types leak null?
- From: Jan Hudec <bulb ucw cz>
- To: vala-list gnome org
- Subject: Re: [Vala] Why do regular reference types leak null?
- Date: Sat, 22 Aug 2009 08:06:31 +0000 (UTC)
Magentus <magentus > writes:
I see two problems with not allowing nulls in regular variables.
One is that a variable starts its life as null (or even worse,
uninitialised), and could be assigned to another variable or returned
No, it can't. Vala implements the same definite assignment rules as C#.
Using an unitialized is an error. Unfortunately, there are few corner cases,
where the definite assignment rules not think the variable might be
uninitialized even though at runtime it can't, but you would just have to
mark it nullable in those cases.
In fact the definitely non-null rules would look quite similar to the
definitely assigned ones.
Regards,
Jan
--
- Jan Hudec <bulb ucw cz>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]