[chuck-users] Scope bug?

Ian South-Dickinson ian.southd at gmail.com
Wed Aug 6 03:00:14 EDT 2014


I encountered a strange case where a variable was changing value within the
scope of an if statement, because I had a superclass with an identical
variable name. I am able to reproduce it with this simple case:

class A
{
    10000 => int foo;
}

class B extends A
{
    fun void bar()
    {
        0 => int foo;

        <<< "a", foo >>>;
        {
            <<< "b", foo >>>;
        }
        <<< "c", foo >>>;
    }
}

Prints out:

a 0
b 10000
c 0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20140806/cc35c94d/attachment.html>


More information about the chuck-users mailing list