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



Sam Danielson wrote:
The following code compiles with no warnings with the 0.7.3 compiler
and segfaults at runtime. I understand that nullable types can be null
but why are regular reference types allowed to be null? I noticed that
if the return type of make_foo is changed from Foo? to Foo I at least
get a warning. But both assignments in main() go unnoticed.

Vala is not yet as strict with non-null types as it could be.

'valac --help' shows an option called '--enable-non-null-experimental'
which might be what you want. I have tried it, but at the moment it
complains about 'glib-2.0.vapi', because many parameters with 'null' as
default value are not marked as nullable.


Best Regards,

Frederik



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