File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -229,6 +229,12 @@ void BitwiseCopyableStorageVisitor::emitNonconformingMemberTypeDiagnostic(
229229static bool checkBitwiseCopyableInstanceStorage (NominalTypeDecl *nominal,
230230 DeclContext *dc,
231231 BitwiseCopyableCheck check) {
232+ if (dc->mapTypeIntoContext (nominal->getDeclaredInterfaceType ())
233+ ->isNoncopyable ()) {
234+ // Already separately diagnosed when explicit.
235+ return true ;
236+ }
237+
232238 assert (dc->getParentModule ()->getASTContext ().getProtocol (
233239 KnownProtocolKind::BitwiseCopyable));
234240
Original file line number Diff line number Diff line change 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 {}
You can’t perform that action at this time.
0 commit comments