Skip to content

Commit d4730e0

Browse files
committed
stdlib: add a semantic attribute to Bool.init(_builtinBooleanLiteral:)
This is required for being able to constant fold boolean literals before the DefiniteInitialization pass
1 parent 74fbae1 commit d4730e0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

stdlib/public/core/Bool.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ public struct Bool: Sendable {
143143

144144
extension Bool: _ExpressibleByBuiltinBooleanLiteral, ExpressibleByBooleanLiteral {
145145
@_transparent
146+
@_semantics("bool.literal_init")
146147
public init(_builtinBooleanLiteral value: Builtin.Int1) {
147148
self._value = value
148149
}

0 commit comments

Comments
 (0)