This happens quite often - I'll have a variable in a Stored Procedure that is not declared (and used in just one area by mistake), yet the IDE doesn't detect it as invalid. This is the perfect example:

Note the SP saves just fine as well. Given the IDE will catch other variable issues (where they don't exist), this appears to be a bug.