Skip to content

Commit 1a9cbbc

Browse files
committed
Docs: Document library evolution restrictions for @inlinable functions.
As documented in the [SE-244 proposal](https://github.com/apple/swift-evolution/blob/main/proposals/0244-opaque-result-types.md#effect-on-api-resilience), it is illegal to change the concrete return type of an @inlinable function with an opaque return type. This ought to be documented since it is an extremely subtle rule that authors of ABI stable libraries should be aware of.
1 parent 3c244c3 commit 1a9cbbc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/LibraryEvolution.rst

+4
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,10 @@ compiler):
262262
- They must not reference any ``internal`` entities except for those that have
263263
been declared ``@usableFromInline`` or ``@inlinable``.
264264

265+
Inlinable functions that return opaque types also have additional restrictions.
266+
The underlying concrete type cannot be changed for such a function without
267+
breaking backward compatibility, because the identity of the concrete type has
268+
been exposed by inlining the body of the function into client modules.
265269

266270
Always Emit Into Client
267271
-----------------------

0 commit comments

Comments
 (0)