Add a check to make sure expressions cannot be passed as ref