Re: [Vala] Why do regular reference types leak null?
- From: Frederik <scumm_fredo gmx net>
- To: vala-list <vala-list gnome org>
- Subject: Re: [Vala] Why do regular reference types leak null?
- Date: Fri, 14 Aug 2009 23:54:45 +0200
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]