fix attr() type inference