[Vala] warning: Foo.new never used



On a tiny program, Vala warns that a constructor is unused when in fact it gets called:

== hello.vala ==
class Foo {
   Foo() {
       stdout.puts("construct\n");
   }
void hello() {
       stdout.puts("hello\n");
   }
static int main(string[] args) {
       Foo f = new Foo();
       f.hello();
       return 0;
   }
}
==========

$ valac hello.vala
hello.vala:2.2-2.4: warning: method `Foo.new' never used
   Foo() {
   ^^^
Compilation succeeded - 1 warning(s)
$ ./hello
construct
hello
$

This is a bug, and I should report it in Bugzilla... right?

adam




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