Commits
Chris Lattner committed 72cb7e84248
Progress on -enable-new-objc-properties: move the code that handles
computation of them to a place that can mutate the members list of
the ClassDecl in question, have the analysis happen in "phase 1" of
the type checker, add the getter/setter to the ClassDecl declcontext,
and make sure they get type checked.
This is enough to fully type check the bodies of these, e.g.:
(func_decl 'anonname=0x7f833c0e5c30' type='C -> () -> Int' getter_for=x
... argument stuff...
(brace_stmt
(return_stmt
(load_expr implicit type='Int'
(member_ref_expr implicit type='@lvalue Int' decl=t.(file).C.x@/Users/sabre/t.swift:4:7
(declref_expr implicit type='C' decl=t.(file).C.func decl.self@/Users/sabre/t.swift:4:7 specialized=no))))))
which is enough for Sema to correctly point out that:
<unknown>:0: warning: attempting to access 'x' within its own getter
<unknown>:0: note: access 'self' explicitly to silence this warning
<unknown>:0: warning: attempting to modify 'x' within its own setter
<unknown>:0: note: access 'self' explicitly to silence this warning
Which means we're on to the next step.
Swift SVN r12964