Handled nested application case in hasWriteInFunction.