better error message for type and macro defs inside functions