File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -241,6 +241,7 @@ class SILTypeProperties {
241241 return HasRawLayout_t ((Flags & HasRawLayoutFlag) != 0 );
242242 }
243243
244+ void setTrivial () { Flags &= ~NonTrivialFlag; }
244245 void setNonTrivial () { Flags |= NonTrivialFlag; }
245246 void setIsOrContainsRawPointer () { Flags |= HasRawPointerFlag; }
246247
Original file line number Diff line number Diff line change @@ -772,8 +772,18 @@ namespace {
772772 type, getReferenceSILTypeProperties (isSensitive));
773773 }
774774 }
775- return asImpl ().handleAddressOnly (
776- type, getOpaqueSILTypeProperties (isSensitive));
775+ auto props = getOpaqueSILTypeProperties (isSensitive);
776+ if (ProtocolDecl *bitwiseCopyable =
777+ TC.Context .getProtocol (KnownProtocolKind::BitwiseCopyable)) {
778+ // If a context is available, then the caller will have mapped into it.
779+ // Opaque function type results still have interface types here.
780+ if (auto conformance =
781+ checkConformanceWithoutContext (type, bitwiseCopyable)) {
782+ if (!conformance->isInvalid ())
783+ props.setTrivial ();
784+ }
785+ }
786+ return asImpl ().handleAddressOnly (type, props);
777787 }
778788
779789 RetTy visitExistentialType (CanType type,
You can’t perform that action at this time.
0 commit comments