Compiler Bug? "Variable x is used before being initialized in all code paths"

function foo(info) {
var x;
if (info.currentLocation != null) {
x = info.currentLocation.toDegrees()[0];
} else {
return 0;
}
var y = x+1;
return y;
}


Result in the following error:

BUILD: ERROR: foo.mc:8: Variable x is used before being initialized in all code paths

which just seems wrong to me. Is the compiler ignoring the first return statement?