[chuck-users] Local-static bug

Hans Aberg haberg at math.su.se
Sat Dec 5 16:50:56 EST 2009

For some reason, 'chuck' does not admit different type argument  
overloading on local & static class functions.

The example below works as long as one does not call the static  
function. So either it should complain that it is illegal when  
encountering it in the class or admit this kind of overloading.

Originally, I used a function "add" on intervals - not as artificial  
as the example below.


---- local-static.ck ----

class Test {
   fun void print(float x) {
     chout <= "Local fun: " <= x <= "\n";
   fun static void print(float x, float y) {
     chout <= "Static fun: (" <= x <= ", " <= y <= ")\n";

Test.print(1, 2); // This call causes the run error.
//Test t;

---- run ----
$ chuck local-static.ck
[local-static.ck]:line(11): cannot access member 'Test.print' without  
object instance...

More information about the chuck-users mailing list