You're certainly right, the compiler should definitely give an error message here. You're using a global struct definition inside a function, which is wrong, but the compiler must indicate this. Otherwise you can look for ages for the reason of the problem.
It's too late for the current release candidate, but it will be fixed in the next update.