Skip to content

Commit cf5000a

Browse files
committed
[BitwiseCopyable] Don't infer for noncopyable.
This bailout was accidentally removed in swiftlang#72856 when removing a duplicative diagnostic. rdar://126135770
1 parent 4e9f7c1 commit cf5000a

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

lib/Sema/TypeCheckBitwise.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,12 @@ static bool checkBitwiseCopyableInstanceStorage(NominalTypeDecl *nominal,
237237
return true;
238238
}
239239

240+
if (dc->mapTypeIntoContext(nominal->getDeclaredInterfaceType())
241+
->isNoncopyable()) {
242+
// Already separately diagnosed when explicit.
243+
return true;
244+
}
245+
240246
assert(dc->getParentModule()->getASTContext().getProtocol(
241247
KnownProtocolKind::BitwiseCopyable));
242248

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-emit-module-interface(%t.swiftinterface) %s -module-name Test -enable-experimental-feature BitwiseCopyable
3+
// RUN: %FileCheck %s < %t.swiftinterface
4+
// RUN: %target-swift-typecheck-module-from-interface(%t.swiftinterface) -module-name Test
5+
6+
7+
@frozen
8+
@_moveOnly
9+
public struct S_Implicit_Noncopyable {}
10+
11+
// CHECK-NOT: extension Test.S_Implicit_Noncopyable : Swift._BitwiseCopyable {}

0 commit comments

Comments
 (0)