<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 21, 2017 at 12:26 AM, Slava Pestov <span dir="ltr">&lt;<a href="mailto:spestov@apple.com" target="_blank">spestov@apple.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space">Thanks for the review, Kelvin.<br><div><span class=""><br><blockquote type="cite"><div>On Dec 20, 2017, at 8:52 PM, Kelvin Ma via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br class="m_-7628949033462156410Apple-interchange-newline"><div><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div><div class="gmail_extra"><div class="gmail_quote"><div>it makes sense to have<span class="m_-7628949033462156410Apple-converted-space"> </span><span style="font-family:monospace,monospace">@abiPublic</span><span class="m_-7628949033462156410Apple-converted-space"> </span>on<span class="m_-7628949033462156410Apple-converted-space"> </span><span style="font-family:monospace,monospace">private</span><span class="m_-7628949033462156410Apple-converted-space"> </span>and<span class="m_-7628949033462156410Apple-converted-space"><wbr> </span><span style="font-family:monospace,monospace">fileprivate</span><span class="m_-7628949033462156410Apple-converted-space"> </span>declarations too and i hope this gets added, because<span class="m_-7628949033462156410Apple-converted-space"> </span><span style="font-family:monospace,monospace">private</span><span class="m_-7628949033462156410Apple-converted-space"> </span>and<span class="m_-7628949033462156410Apple-converted-space"> </span><span style="font-family:monospace,monospace">fileprivat<wbr>e</span><span class="m_-7628949033462156410Apple-converted-space"> </span>are tools for code organization and maintenance,, the compiler with wmo doesn’t care about<span class="m_-7628949033462156410Apple-converted-space"> </span><span style="font-family:monospace,monospace">private</span><span class="m_-7628949033462156410Apple-converted-space"> </span>vs<span class="m_-7628949033462156410Apple-converted-space"> </span><span style="font-family:monospace,monospace">internal</span>. but<span class="m_-7628949033462156410Apple-converted-space"> </span><span style="font-family:monospace,monospace">@abiPublic private</span><span class="m_-7628949033462156410Apple-converted-space"> </span>is bound to cause confusion and it just reads funny.<span class="m_-7628949033462156410Apple-converted-space"> </span><br></div></div></div></div></div></div></blockquote><div><br></div></span>From an implementation standpoint, it would be a simple change to allow @abiPublic on private and fileprivate declarations. However, I think that introduce some confusion. Recall that the mangling of private symbols includes the source file name. This would now be part of your framework’s ABI. If you moved the @abiPublic function to another source file, or rename the source file, you will break ABI.</div><div><br></div><div>Another approach would be to change the mangling so that @abiPublic private symbols are mangled like internal symbols, with a module name and no source file name. This makes for a simpler ABI. However this also has a downside, because now if you define two @abiPublic private functions in different files that have the same mangling, you will get a linker error and not a nice compiler diagnostic.</div><div><br></div><div>Note that nothing in this proposal precludes @abiPublic from being applied to private and fileprivate symbols though. If we figure out a nice solution to the above problems, we could generalize @abiPublic without any issues.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Slava</div><br></font></span></div></blockquote></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">i understand that but i also feel like that’s a completely solvable problem if someone put in some effort to look into it. right now i think fileprivate is the only problematic keyword with this since i think changing the name of a private type makes a lot more sense that it would break abi than renaming a file would. but it’s also the least used so that’s a plus. <br></div></div>