What does `@inlinable` inside a protocol do?

I noticed that I can do

public protocol Foo {
  @inlinable func bar()
}

What does @inlinable do in this context? My first instinct is that it implicitly declare all bar Inlinable, but the experiment doesn't seem to agree (I still need to mark individual bar to get inline performance).

4 Likes

Just a thought, didn't try it myself: If you provide a default implementation of bar in Foo's extension, do you still need to mark it @inlinable again for it to be inliable?

1 Like