> On Oct 2, 2017, at 2:20 PM, Greg Parker <gpar...@apple.com> wrote:
> 
> 
>> On Oct 2, 2017, at 1:31 PM, Slava Pestov via swift-evolution 
>> <swift-evolution@swift.org <mailto:swift-evolution@swift.org>> wrote:
>> inlinable declarations can only reference other public declarations. This is 
>> because they can be emitted into the client binary, and are therefore 
>> limited to referencing symbols that the client binary can reference.
>> 
> 
> Private @inlinable functions are useful. For example, you might want a helper 
> function to be inlined into a public @inlinable function for performance, but 
> you don't want that helper function to be called by outside clients directly. 
> 
> The restriction would then be "inlinable declarations can only reference 
> other public declarations and other @inlinable non-public declarations". This 
> relaxation would have no affect on ABI: only @inlinable things could be 
> inlined, and only public things could be ultimately referenced by inlined 
> things. 
> 
> Having said that, it should be fine to use "public @inlinable only" for now 
> and consider relaxing the restriction later.

That’s what @_versioned is currently for. You can define a function as 
@_versioned @_inlineable and reference it from other public inlinable 
functions, without making it visible to AST-level lookup.

While I would prefer to punt formalizing  this to a future proposal, we can 
still design the correct spelling and behavior of @_versioned here (I’m pretty 
sure the current attribute isn’t it).

Slava

> 
> 
> -- 
> Greg Parker     gpar...@apple.com <mailto:gpar...@apple.com>     Runtime 
> Wrangler
> 
> 

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to