Property attribute visible shows Error in function

I have a property where I use getter and setter I used to do this for any variable, and
I get an error. It is working, but I want to know the reason for the error.

You can use this writing style

Thanks alot