After actually compiling it, I don't get any error with your snippet (with either snippet). So either provide the exact code you used to produce the error or there is nothing wrong
I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).