tomitrescak / clara-support

0 stars 0 forks source link

Compiler problems with calling a method and a variable the same #118

Closed antonwsu closed 2 years ago

antonwsu commented 3 years ago

A student has submitted the code below, where a variable and a method share the same name. The code doesn't run (run button grayed out) but the error is not reported.

int claraAnimation = 0;

public void act()
{
    claraMovement();
    claraAnimation();  
}

void claraAnimation()
{
    claraAnimation++;

    if (claraAnimation%60 == 0)
    {
        animate();
    }   
}
tomitrescak commented 2 years ago

Solved:

image