Type resolution for variables