backport fix from 1.5 for "can't declare scalar assignment in my" error