Try using @code_warntype to spot type instabilities. The quoted code is a hint at a likely instability.
@code_warntype