fix Issue 9504 - typeof does not look up properties correctly on template argument

The identifiers followed by typeof(exp) or typeod(return) may be resolved to symbol or expression. Type[Typeof|Return]::resolve should consider it.