<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><div><blockquote type="cite" class="clean_bq" style="color: rgb(0, 0, 0); font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Do the usual lookup to find the method which implements this syntax. Call <span style="font-family: Menlo; font-size: 11px; color: rgb(79, 129, 135);">Decl</span><span style="font-family: Menlo; font-size: 11px;">::getAvailability on this method. If it returns</span></div><div><span style="font-family: Menlo; font-size: 11px;">anything other than </span><span style="font-family: Menlo; font-size: 11px;">AvailabilityResult::</span><font face="Menlo"><span style="font-size: 11px;">AR_Available </span></font></div></div></blockquote></div><p>Well, I understand this part, it’s pretty obvious. But what I don’t understand is:</p><div><div><blockquote type="cite" class="clean_bq" style="color: rgb(0, 0, 0); font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><font face="Menlo"><span style="font-size: 11px;">issue an appropriate diagnostic.</span></font></div></blockquote></div><p>What is appropriate diagnostic for <span style="color: rgb(49, 89, 93); font-family: Menlo; font-size: 11px;">AR_NotYetIntroduced?</span></p><div>Should I introduce this diagnostic? Or just show warning/error for Deprecated/Unavailable and ignore NotYetIntroduced AR?</div></div><div><br></div><div>Please, take my apologies for annoying questions.</div></div> <div id="bloop_sign_1419420013784364032" class="bloop_sign"><div style="font-family:helvetica,arial;font-size:13px">-- <br>AlexDenisov</div><div style="font-family:helvetica,arial;font-size:13px">Software Engineer, <a href="https://github.com/AlexDenisov">https://github.com/AlexDenisov</a></div></div> <br><p style="color:#000;">On 24 Dec 2014 at 00:13:12, jahanian (<a href="mailto:fjahanian@apple.com">fjahanian@apple.com</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div></div><div>



<title></title>



<br>
<div>
<div>On Dec 22, 2014, at 1:33 PM, AlexDenisov <<a href="mailto:1101.debian@gmail.com">1101.debian@gmail.com</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
Sorry, but I completely stuck.</div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
<div>
<blockquote type="cite" class="clean_bq" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div>After you look up the method to use, you should call
the <span style="font-family: Menlo; font-size: 11px;">getAvailability() on it and
if it is unavailable or </span></div>
<div><font face="Menlo"><span style="font-size: 11px;">not yet
introduced, you should issue an appropriate diagnostic
(error).</span></font></div>
</div>
</blockquote>
</div>
<p>But</p>
<div>
<div>
<blockquote type="cite" class="clean_bq" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
Looks like there is policy to not issue diagnostics on not yet
introduced methods (grep for <span style="color: rgb(49, 89, 93); font-family: Menlo; font-size: 11px;">AR_NotYetIntroduced
in clang).</span></div>
</blockquote>
</div>
<p>Could you, please, describe the expected behaviour more
precisely? Thank you.</p>
<div><br></div>
</div>
</div>
</div>
</blockquote>
<div><br></div>
Do the usual lookup to find the method which implements this
syntax. Call <span style="font-family: Menlo; font-size: 11px; color: rgb(79, 129, 135);">Decl</span><span style="font-family: Menlo; font-size: 11px;">::getAvailability
on this method. If it returns</span></div>
<div><span style="font-family: Menlo; font-size: 11px;">anything
other than </span><span style="font-family: Menlo; font-size: 11px;">AvailabilityResult::</span><font face="Menlo"><span style="font-size: 11px;">AR_Available
issue an appropriate diagnostic. But continue
generating</span></font></div>
<div><font face="Menlo"><span style="font-size: 11px;">the AST so
there will be a valid AST.</span></font></div>
<div><font face="Menlo"><span style="font-size: 11px;"><br></span></font></div>
<div><font face="Menlo"><span style="font-size: 11px;">-
Fariborz</span></font></div>
<div><font face="Menlo"><span style="font-size: 11px;"><br></span></font></div>
<div><font face="Menlo"><span style="font-size: 11px;"><br></span></font>
<blockquote type="cite">
<div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div id="bloop_sign_1419283579136719104" class="bloop_sign">
<div style="font-family: helvetica, arial; font-size: 13px;">
-- <br>
AlexDenisov</div>
<div style="font-family: helvetica, arial; font-size: 13px;">
Software Engineer, <a href="https://github.com/AlexDenisov">https://github.com/AlexDenisov</a></div>
</div>
<br>
<p style="">On 19 Dec 2014 at 18:26:47, jahanian (<a href="mailto:fjahanian@apple.com">fjahanian@apple.com</a>) wrote:</p>
<blockquote type="cite" class="clean_bq">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div><span><br></span>
<div>
<div><span>On Dec 18, 2014, at 10:28 AM, AlexDenisov <<a href="mailto:1101.debian@gmail.com">1101.debian@gmail.com</a>>
wrote:</span></div>
<span><br class="Apple-interchange-newline"></span>
<blockquote type="cite">
<div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
<span>Ok, I got it, but still can’t understand what is desired
behaviour? How should compiler behave in this
situation?</span></div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
<span>I tried to find any related functionality at
NSNumber/NSString implementation - but, no luck.</span></div>
</div>
</blockquote>
<div><span><br></span></div>
<span>After you look up the method to use, you should call
the <span style="font-family: Menlo; font-size: 11px;">getAvailability() on it and
if it is unavailable or </span></span></div>
<div><font face="Menlo"><span style="font-size: 11px;">not yet
introduced, you should issue an appropriate diagnostic
(error). But you probably want to </span></font></div>
<div><font face="Menlo"><span style="font-size: 11px;">continue
producing the AST, etc. so to cut down on any followup errors
which might show up.</span></font></div>
<div><font face="Menlo"><span style="font-size: 11px;">-
Fariborz</span></font></div>
<div><font face="Menlo"><span style="font-size: 11px;"><br></span></font>
<blockquote type="cite">
<div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
<br></div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">P.S.
also I’ve found that a few tests are missing and some
literals-related diagnostic are weird, so a few patches are
coming.</div>
<div id="bloop_sign_1418927086726212864" class="bloop_sign">
<div style="font-family: helvetica, arial; font-size: 13px;">
-- <br>
AlexDenisov</div>
<div style="font-family: helvetica, arial; font-size: 13px;">
Software Engineer, <a href="https://github.com/AlexDenisov">https://github.com/AlexDenisov</a></div>
</div>
<br>
<p>On 15 Dec 2014 at 19:59:01, jahanian (<a href="mailto:fjahanian@apple.com">fjahanian@apple.com</a>) wrote:</p>
<blockquote type="cite" class="clean_bq">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<span>Looks like there is policy to not issue diagnostics on not
yet introduced methods</span>
<div><span>(grep for <span style="color: rgb(49, 89, 93); font-family: Menlo; font-size: 11px;">AR_NotYetIntroduced
in clang). So you need to handle this </span></span></div>
<div><font color="#31595D" face="Menlo"><span style="font-size: 11px;">yourself by making the call
to </span></font><span style="font-family: Menlo; font-size: 11px; color: rgb(79, 129, 135);">Decl</span><span style="font-family: Menlo; font-size: 11px;">::getAvailability.</span></div>
<div><font face="Menlo"><span style="font-size: 11px;">-
Fariborz</span></font></div>
<div><font face="Menlo"><span style="font-size: 11px;"><br></span></font>
<div>
<div>On Dec 13, 2014, at 10:08 AM, AlexDenisov <<a href="mailto:1101.debian@gmail.com">1101.debian@gmail.com</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
Well, I started implementation of warnings regarding availability
and faced with an issue:</div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">I
decided to check how clang behaves and what kind of diagnostics it
shows in that situation, </div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">but
I've found that clang just compiles the code without any
warnings.</div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
<br></div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">I've
run this command:</div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
<br></div>
<div id="bloop_customfont" style="margin: 0px;">clang main.m
-fsyntax-only -fmodules -Weverything</div>
<div id="bloop_customfont" style="margin: 0px;"><br></div>
<div id="bloop_customfont" style="margin: 0px;">with this
code:</div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
<br></div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
//main.m</div>
<div id="bloop_customfont" style="margin: 0px;">
<div id="bloop_customfont" style="margin: 0px;">@import
Foundation;</div>
<div id="bloop_customfont" style="margin: 0px;"><br></div>
<div id="bloop_customfont" style="margin: 0px;">@interface Future :
NSObject</div>
<div id="bloop_customfont" style="margin: 0px;">+
(instancetype)newFuture
__attribute__((availability(macosx,introduced=10.10)));</div>
<div id="bloop_customfont" style="margin: 0px;">@end</div>
<div id="bloop_customfont" style="margin: 0px;"><br></div>
<div id="bloop_customfont" style="margin: 0px;">@implementation
Future</div>
<div id="bloop_customfont" style="margin: 0px;">+
(instancetype)newFuture { return nil; }</div>
<div id="bloop_customfont" style="margin: 0px;">@end</div>
<div id="bloop_customfont" style="margin: 0px;"><br></div>
<div id="bloop_customfont" style="margin: 0px;">int main(int argc,
const char * argv[]) {</div>
<div id="bloop_customfont" style="margin: 0px;">  Future *f =
[Future newFuture];</div>
<div id="bloop_customfont" style="margin: 0px;">  return f ==
nil;</div>
<div id="bloop_customfont" style="margin: 0px;">}</div>
</div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
<br></div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">And
everything was just fine (excerpt of unused variables
argc/argv).</div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
<br></div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">So
the question is: what is expected behaviour regarding boxed
expressions and availability?</div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">I
can’t even find such tests for NSNumber/NSString.</div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
<br></div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">I
would appreciate any suggestions or advice.</div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
<br></div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">Best
regards, Alex.</div>
<div id="bloop_sign_1418493320057667072" class="bloop_sign">
<div style="font-family: helvetica, arial; font-size: 13px;">
-- <br>
AlexDenisov</div>
<div style="font-family: helvetica, arial; font-size: 13px;">
Software Engineer, <a href="https://github.com/AlexDenisov">https://github.com/AlexDenisov</a></div>
</div>
<br>
<p>On 11 Dec 2014 at 22:12:06, AlexDenisov (<a href="mailto:1101.debian@gmail.com">1101.debian@gmail.com</a>)
wrote:</p>
<blockquote type="cite" class="clean_bq">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
<span>> there is a good chance we won’t be adding boxing of
pointers. </span></div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
<span><br></span></div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
<span>Do you mean pointers to void (valueWithPointer) or all the
pointers, like NSObject *
(valueWithNonretainedObject)?</span></div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
<span><br></span></div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
<span>Anyway, should I get rid of that functionality before
submitting updated patch or keep it and, probably, drop
later?</span></div>
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; margin: 0px;">
<span><br></span></div>
<div id="bloop_sign_1418332207474221056" class="bloop_sign">
<div style="font-family: helvetica, arial; font-size: 13px;">
<span>-- <br>
AlexDenisov</span></div>
<div style="font-family: helvetica, arial; font-size: 13px;">
<span>Software Engineer, <a href="https://github.com/AlexDenisov">https://github.com/AlexDenisov</a></span></div>
</div>
<span><br></span>
<p><span>On 10 Dec 2014 at 23:00:38, jahanian (<a href="mailto:fjahanian@apple.com">fjahanian@apple.com</a>)
wrote:</span></p>
<blockquote type="cite" class="clean_bq">
<div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<span><br class=""></span>
<div>
<blockquote type="cite" class="">
<div class=""><span>On Dec 9, 2014, at 12:21 AM, AlexDenisov
<<a href="mailto:1101.debian@gmail.com" class="">1101.debian@gmail.com</a>> wrote:</span></div>
<div class="">
<div id="bloop_customfont" class="" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px;">
<span><br class=""></span>
<div id="bloop_customfont" class="" style="margin: 0px;">
<span><br class=""></span></div>
<div id="bloop_customfont" class="" style="margin: 0px;">
<span>>> Also, why can’t place this under the umbrella
objc_boxed_expressions?</span></div>
<div id="bloop_customfont" class="" style="margin: 0px;">
<span><br class=""></span></div>
<div id="bloop_customfont" class="" style="margin: 0px;">
<span>Version 3.5, for example, supports objc_boxed_expression but
not NSValue+boxed_expressions, </span></div>
<div id="bloop_customfont" class="" style="margin: 0px;">
<span>which might cause weird compilation fails. Or did I get it
wrong?</span></div>
</div>
</div>
</blockquote>
<span>No wrong :).</span></div>
<div><span><br class=""></span>
<blockquote type="cite" class="">
<div class="">
<div id="bloop_customfont" class="" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; margin: 0px;">
<div id="bloop_customfont" class="" style="margin: 0px;">
<span><br class=""></span></div>
<div id="bloop_customfont" class="" style="margin: 0px;"><span>+
       // Otherwise, require a declaration of
NSValue.</span></div>
<div id="bloop_customfont" class="" style="margin: 0px;"><span>+
       S.Diag(Loc,
diag::err_undeclared_nsvalue);</span></div>
<div id="bloop_customfont" class="" style="margin: 0px;"><span>+
       return nullptr;</span></div>
<div id="bloop_customfont" class="" style="margin: 0px;"><span>+
     }</span></div>
<div id="bloop_customfont" class="" style="margin: 0px;"><span>+
   } else if (!S.NSValueDecl->hasDefinition())
{</span></div>
<div id="bloop_customfont" class="" style="margin: 0px;"><span>+
     S.Diag(Loc,
diag::err_undeclared_nsvalue);</span></div>
<div id="bloop_customfont" class="" style="margin: 0px;">
<span><br class=""></span></div>
<div id="bloop_customfont" class="" style="margin: 0px;">
<span>>> Maybe we should have a clearer diagnostic
here.</span></div>
<div id="bloop_customfont" class="" style="margin: 0px;">
<span><br class=""></span></div>
<div id="bloop_customfont" class="" style="margin: 0px;">
<span>Makes sense, I used NSNumber' implementation here. I'd
appreciate any suggestions or advice on </span></div>
<div id="bloop_customfont" class="" style="margin: 0px;"><span>how
to improve diagnostic here (and, probably, for
NSNumber)</span></div>
</div>
</div>
</blockquote>
<div><span><br class=""></span></div>
<span>Probably should allude to NSValue (or NSNumber) having no
definition (only forward declared).  </span></div>
<div><span>But, it is not something I strongly argue
for.</span></div>
<div><span><br class=""></span></div>
<div><span>P.S. there is a good chance we won’t be adding boxing of
pointers. </span></div>
<div><span><br class=""></span></div>
<div><span>Thanks, Fairborz</span></div>
</div>
</blockquote>
</div>
</blockquote>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
<br>


</div></div></span></blockquote></body></html>