[Vala] [Bug?] Access to non-static field are permitted inside static methods




I've noticed now after finding a bug in my program, that access to
non-static field are permitted inside static methods!
I didn't believed no one was noticed this until now...
Here is a code shows the behavior:
class A {
  int num = 0;
  static void foo () {
    if (num == 0)
      num++;
  }
}

Vala compiles "num" in "foo" into an unsigned _tmp*_.
Hope it was helpful.

Tal
                                          


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