File tree Expand file tree Collapse file tree 3 files changed +49
-3
lines changed Expand file tree Collapse file tree 3 files changed +49
-3
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,8 @@ getImplicitCheckForNominal(NominalTypeDecl *nominal) {
5757 if (!nominal
5858 ->getFormalAccessScope (
5959 /* useDC=*/ nullptr , /* treatUsableFromInlineAsPublic=*/ true )
60- .isPublic ())
60+ .isPublic () ||
61+ !nominal->isResilient ())
6162 return {BitwiseCopyableCheck::Implicit};
6263
6364 if (nominal->hasClangNode () ||
Original file line number Diff line number Diff line change @@ -62,8 +62,7 @@ struct S_Explicit_With_Function_C : _BitwiseCopyable {
6262public struct S_Public { }
6363
6464struct S_Explicit_With_S_Public : _BitwiseCopyable {
65- var s : S_Public // expected-error {{non_bitwise_copyable_type_member}}
66- // expected-note@-4 {{add_nominal_bitwise_copyable_conformance}}
65+ var s : S_Public
6766}
6867
6968struct S_Explicit_With_Generic < T> : _BitwiseCopyable {
Original file line number Diff line number Diff line change 1+ // RUN: %empty-directory(%t)
2+ // RUN: split-file %s %t
3+
4+ // RUN: %target-swift-frontend \
5+ // RUN: %t/Library.swift \
6+ // RUN: -emit-module \
7+ // RUN: -enable-experimental-feature BitwiseCopyable \
8+ // RUN: -module-name Library \
9+ // RUN: -emit-module-path %t/Library.swiftmodule
10+
11+ // RUN: %target-swift-frontend \
12+ // RUN: %t/Downstream.swift \
13+ // RUN: -typecheck -verify \
14+ // RUN: -debug-diagnostic-names \
15+ // RUN: -enable-experimental-feature BitwiseCopyable \
16+ // RUN: -I %t
17+
18+ //--- Library.swift
19+ public enum Oopsional < T> {
20+ case someone( Int )
21+ case nobody
22+ }
23+
24+ @frozen public enum Woopsional < T> {
25+ case somebody( Int )
26+ case noone
27+ }
28+
29+ //--- Downstream.swift
30+ import Library
31+
32+ func take< T: _BitwiseCopyable > ( _ t: T ) { }
33+
34+ struct S_Explicit_With_Oopsional < T> : _BitwiseCopyable {
35+ var o : Oopsional < T >
36+ }
37+
38+ func passOopsional< T> ( _ t: Oopsional < T > ) { take ( t) }
39+
40+
41+ struct S_Explicit_With_Woopsional < T> : _BitwiseCopyable {
42+ var o : Woopsional < T >
43+ }
44+
45+ func passWoopsional< T> ( _ t: Woopsional < T > ) { take ( t) }
46+
You can’t perform that action at this time.
0 commit comments