Skip to content

Commit 39dc431

Browse files
committed
Adjust use of @_transparent
Avoid using `@inlinable @_transparent` — the `@_transparent` attribute already implies inlinability, although evidently without the `@usableFromInline` parts. (`internal @_transparent` functions aren’t allowed to be called from inlinable functions.) `@usableFromInline @_transparent` or `@_alwaysEmitIntoClient @_transparent` expresses the author’s intention better, making the choice of exposing a symbol explicit.
1 parent 66c4937 commit 39dc431

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Sources/ArrayModule/DynamicArray+Experimental.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ extension DynamicArray where Element: ~Copyable {
6969

7070
extension DynamicArray where Element: ~Copyable {
7171
@available(SwiftStdlib 5.0, *)
72-
@inlinable
72+
@_alwaysEmitIntoClient
7373
@_transparent
7474
internal mutating func _edit<R: ~Copyable>(
7575
freeCapacity: Int,

Sources/ArrayModule/DynamicArray.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ extension DynamicArray where Element: ~Copyable {
258258

259259
//MARK: - Resizing
260260

261-
@inlinable
261+
@_alwaysEmitIntoClient
262262
@_transparent
263263
internal func _growDynamicArrayCapacity(_ capacity: Int) -> Int {
264264
2 * capacity
@@ -275,14 +275,14 @@ extension DynamicArray where Element: ~Copyable {
275275
_storage.reserveCapacity(n)
276276
}
277277

278-
@inlinable
278+
@_alwaysEmitIntoClient
279279
@_transparent
280-
public mutating func _ensureFreeCapacity(_ freeCapacity: Int) {
280+
internal mutating func _ensureFreeCapacity(_ freeCapacity: Int) {
281281
guard _storage.freeCapacity < freeCapacity else { return }
282282
_ensureFreeCapacitySlow(freeCapacity)
283283
}
284284

285-
@inlinable
285+
@_alwaysEmitIntoClient
286286
@_transparent
287287
internal func _grow(freeCapacity: Int) -> Int {
288288
Swift.max(

0 commit comments

Comments
 (0)