This error happens all the time, and in fact before I write even one line of code (just dropped a component and double-clicked on the event). In 1.0 it does not happen, neither it did in previous trunk builds.
However similar errors do happen sometimes and the error messages can be misleading because they often point to a different part of code like you said. Unfortunately not the case here... In fact, and I forgot to mention this before, the code compiles fine, so definitely the problem is in the IDE only.