Skip to content

Commit 5030c82

Browse files
committed
stdlib: annotate the compiler intrinsic function _arrayConditionalCast with a semantic attribute
This is need for the optimizer to remove redundant array casts
1 parent 275a679 commit 5030c82

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

stdlib/public/core/ArrayCast.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ internal func _arrayDownCastConditionalIndirect<SourceValue, TargetValue>(
7171
///
7272
/// - Complexity: O(n), because each element must be checked.
7373
@inlinable //for performance reasons
74+
@_semantics("array.conditional_cast")
7475
public func _arrayConditionalCast<SourceElement, TargetElement>(
7576
_ source: [SourceElement]
7677
) -> [TargetElement]? {

0 commit comments

Comments
 (0)