[chuck-users] Static bug

Hans Aberg haberg at math.su.se
Tue Nov 24 13:51:56 EST 2009


For some reason, 'chuck' does not instantiate class static constants  
until there has been an instantiation of the class itself.

   Hans

---- static.ck ----
class Test {
   3 => static int d;

   fun static void print() {
     if (d == 0)  chout <= "Nope!\n";
     else  chout <= "Yep.\n";
   }
}

Test.print();
Test test_;
Test.print();

---- run ----
$ chuck static.ck
Nope!
Yep.
----



More information about the chuck-users mailing list