Skip to content

Commit 86dcce1

Browse files
committed
[StdlibUnittest] Don't catch ObjC exceptions on non-ObjC platforms.
My apologies!
1 parent 65c86b7 commit 86dcce1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

stdlib/private/StdlibUnittest/StdlibUnittest.swift.gyb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,12 +448,16 @@ let _crashedPrefix = "CRASHED:"
448448
@_silgen_name("swift_stdlib_installTrapInterceptor")
449449
func _stdlib_installTrapInterceptor()
450450

451+
#if _runtime(_ObjC)
451452
@objc protocol _StdlibUnittestNSException {
452-
optional var name: String { get }
453+
optional var name: AnyObject { get }
453454
}
455+
#endif
454456

455457
func _childProcess() {
456458
_stdlib_installTrapInterceptor()
459+
460+
#if _runtime(_ObjC)
457461
objc_setUncaughtExceptionHandler {
458462
var stderr = _Stderr()
459463
let maybeNSException = unsafeBitCast($0, to:_StdlibUnittestNSException.self)
@@ -466,6 +470,8 @@ func _childProcess() {
466470
to: &stderr)
467471
}
468472
}
473+
#endif
474+
469475
while let line = _stdlib_getline() {
470476
let parts = line._split(separator: ";")
471477
let testSuiteName = parts[0]

0 commit comments

Comments
 (0)