Skip to content

Commit 4f592f0

Browse files
authored
Merge pull request #70407 from kubamracek/embedded-placeholders
[embedded] Fix editor placeholders by adding a StaticString variant of _undefined
2 parents 06f9c01 + 8ee33d2 commit 4f592f0

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

stdlib/public/core/AssertCommon.swift

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,9 @@ func _unimplementedInitializer(className: StaticString,
252252
Builtin.int_trap()
253253
}
254254

255-
@_unavailableInEmbedded
255+
#if !$Embedded
256+
257+
/// Used to evaluate editor placeholders.
256258
public // COMPILER_INTRINSIC
257259
func _undefined<T>(
258260
_ message: @autoclosure () -> String = String(),
@@ -261,6 +263,19 @@ func _undefined<T>(
261263
_assertionFailure("Fatal error", message(), file: file, line: line, flags: 0)
262264
}
263265

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

0 commit comments

Comments
 (0)