Skip to content

Commit 29b7ce2

Browse files
committed
PrintAsClang: Change a couple of isAny() checks into isMarkerExistential()
1 parent 2b2beb6 commit 29b7ce2

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/PrintAsClang/DeclAndTypePrinter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static bool isNSObjectOrAnyHashable(ASTContext &ctx, Type type) {
6060
}
6161

6262
static bool isAnyObjectOrAny(Type type) {
63-
return type->isAnyObject() || type->isAny();
63+
return type->isAnyObject() || type->isMarkerExistential();
6464
}
6565

6666
// For a given Decl and Type, if the type is not an optional return
@@ -2377,7 +2377,7 @@ class DeclAndTypePrinter::Implementation
23772377
// Use the type as bridged to Objective-C unless the element type is itself
23782378
// an imported type or a collection.
23792379
const StructDecl *SD = ty->getStructOrBoundGenericStruct();
2380-
if (ty->isAny()) {
2380+
if (ty->isMarkerExistential()) {
23812381
ty = ctx.getAnyObjectType();
23822382
} else if (!ty->isKnownStdlibCollectionType() && !isSwiftNewtype(SD)) {
23832383
ty = ctx.getBridgedToObjC(&owningPrinter.M, ty);

test/Concurrency/emit_objc_header_with_Sendable.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import Foundation
2020
@objc public protocol Q {
2121
// CHECK: - (NSArray<NSDictionary<NSString *, id> *> * _Nonnull)data1 SWIFT_WARN_UNUSED_RESULT;
2222
func data1() -> [[String: any Sendable]]
23-
// CHECK: - (NSArray<id> * _Nullable)data2 SWIFT_WARN_UNUSED_RESULT;
23+
// CHECK: - (NSArray * _Nullable)data2 SWIFT_WARN_UNUSED_RESULT;
2424
func data2() -> [any Sendable]?
2525
// CHECK: - (void)data3:(id _Nonnull)_;
2626
func data3(_: any Sendable)

0 commit comments

Comments
 (0)