Re: [Vala] guess_language warning



Hi,

2009/11/10 James Campos <james r campos gmail com>:
The guess_language method of a SourceLanguageManager object allows one
null parameter, but when I use it, I get a warning:

james james-desktop:~/code/vala$ valac --pkg gtk+-2.0 --pkg
gtksourceview-2.0 scratch.vala
scratch.vala:9.41-9.44: warning: Argument 2: Cannot pass null to
non-null parameter type
               langManager.guess_language (filepath, null);
                                                     ^^^^
Compilation succeeded - 1 warning(s)
james james-desktop:~/code/vala$ cat scratch.vala
using Gtk;

public class Foo {

       public static int main (string[] args) {

               var filepath = "/home/james/code/vala/scratch.vala";
               var langManager = SourceLanguageManager.get_default ();
               langManager.guess_language (filepath, null);

               return 0;
       }
}


Question: should I continue reporting these strange warnings? Vala
seems to have plenty of them....

sure, if you get a warning from Vala, either you are doing something
wrong or the bindings are wrong.

It would be yet better if you could provide patches for these. In this
case, it's just a matter of adding something like :
gtk_source_language_manager_guess_language.<arg_name> nullable="1"
to vapi/packages/gtksourceview-2.0/gtksourceview-2.0.metadata and
regenerating the bindings.

HTH,
Abderrahim



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