Skip to content

Commit 996f51e

Browse files
committed
[embedded] Fix editor placeholders by adding a StaticString variant of _undefined
1 parent 0f71674 commit 996f51e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

stdlib/public/core/AssertCommon.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ func _unimplementedInitializer(className: StaticString,
252252
Builtin.int_trap()
253253
}
254254

255+
/// Used to evaluate editor placeholders.
255256
@_unavailableInEmbedded
256257
public // COMPILER_INTRINSIC
257258
func _undefined<T>(
@@ -261,6 +262,15 @@ func _undefined<T>(
261262
_assertionFailure("Fatal error", message(), file: file, line: line, flags: 0)
262263
}
263264

265+
/// Used to evaluate editor placeholders.
266+
public // COMPILER_INTRINSIC
267+
func _undefined<T>(
268+
_ message: @autoclosure () -> StaticString = StaticString(),
269+
file: StaticString = #file, line: UInt = #line
270+
) -> T {
271+
_assertionFailure("Fatal error", message(), file: file, line: line, flags: 0)
272+
}
273+
264274
/// Called when falling off the end of a switch and the type can be represented
265275
/// as a raw value.
266276
///

0 commit comments

Comments
 (0)