[LLVMbugs] [Bug 7495] LLVM/Clang does not allow ivar access for synthesised ivars without @synthesized

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jul 1 03:53:38 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=7495

Dave Verwer <dave.verwer at shinydevelopment.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |dave.verwer at shinydevelopmen
                   |                            |t.com
         Resolution|WORKSFORME                  |

--- Comment #4 from Dave Verwer <dave.verwer at shinydevelopment.com> 2010-07-01 05:53:37 CDT ---
I just found out about the plans to change this functionality from Martin and I
would like to suggest that the proposed change as mentioned by Fariborz is not
made.

I don't like the idea of accessing completely undeclared ivars, it makes it too
easy to write misleading code mistakenly accessing an ivar that is not
explicitly defined rather than accessing it through the accessors.

I would like to propose it works like this:

* If an ivar is undeclared (with or without synthesize), the ivar is not
directly accessible but the property is created and is accessible through the
getters and setters/dot syntax.
* When you do need to access an ivar directly it must be explicitly declared
and synthesized.

This way there is no magic at all and in the majority of cases the ivar and
synthesize can still be omitted.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list