Re: [Vala] Why do regular reference types leak null?



On 08/14/2009 10:57 PM, Sam Danielson wrote:
Why shouldn't they be null? IMO, it would just add much more trouble.
Checking nulls is responsibility of the programmer. That is consistent with
every other language I know, including dynamic ones, C#, Java, etc.
Perhaps I am misunderstanding the purpose of nullable types. The Vala
tutorial explains, "By default, Vala will make sure that all reference
point to actual objects." As I understand, the whole point of Foo? is
so that we can have nulls without infecting Foo with a null variant.


That section is wrong. (Who the hell wrote that?)

It only applies to method arguments and return values, not variables. Any variable of a reference type can be null, regardless of how it is defined. According to juergbi, it has always been that way, and it will not change in the near future (the analysis is way too complicated, I personally don't see the need anyway).




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]