Ensure that #if stripping for postfix expressions works in interface generation

Test case from rdar://117491193
This commit is contained in:
Doug Gregor
2024-09-06 09:47:35 -07:00
parent ac850bf86f
commit 08eefcbbcc

View File

@@ -329,3 +329,17 @@ public class HasDefaultDeinit {
// CHECK: [[OBJC]]deinit{{$}}
// CHECK-NEXT: }
}
// CHECK: public func testInlinableTextRemovesPostfix()
@inlinable public func testInlinableTextRemovesPostfix() {
// FROMSOURCE: "foobar"
// FROMSOURCE-NOT: .debugDescription
// FROMSOURCE: .description
// FROMSOURCE-NEXT: }
_ = "foobar"
#if DEBUG
.debugDescription
#else
.description
#endif
}