Checking type of expression for write operation