Re: [Vala] Heads-up on upcoming non-null support




On Sun, Apr 13, 2008 at 10:11 PM, Jürg Billeter <j bitron ch> wrote:
On Tue, 2008-04-08 at 19:07 +0200, Jürg Billeter wrote:
> So far, Vala doesn't use the non-null type information by default, i.e.
> your application will work fine even if you don't specify the `?` type
> suffix for possibly-null types. That's about to change in the upcoming
> 0.3.x releases. Automatic generation of runtime checks for method
> parameters will be enabled by default, which means that if you pass null
> to a method and forget to add the `?` to the parameter type, you'll get
> a critical runtime warning.

This has been enabled now in Vala SVN trunk. There are two new
commandline options:

   --disable-non-null             revert to the behavior of Vala 0.2.0
                                  in case you want to update Vala but
                                  haven't ported your code yet

   --enable-non-null-experimental warn whenever you try to use a
                                  possibly-null type as a non-null
                                  type, this is still work in progress
                                  and considered experimental

Jürg


Thanks!

I modified my code and I already feel I know much more about my own methods!
This was an interesting 'touch'.

I really like the fact that I'm learning C# along with Vala:)

Vlad

p.s. of course there are some bindings bugs now - e.g.:

gtk_image_menu_item_new_from_stock.accel_group nullable="1"
should supposely be in gtk metadata but I don't know how to run vapigen or I miss something: vapigen --vapidir . --library gtk+-2.0 packages/gtk+-2.0/gtk+-2.0.gi
gives me errors that some types are missing.


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