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) {
57
57
if (!nominal
58
58
->getFormalAccessScope (
59
59
/* useDC=*/ nullptr , /* treatUsableFromInlineAsPublic=*/ true )
60
- .isPublic ())
60
+ .isPublic () ||
61
+ !nominal->isResilient ())
61
62
return {BitwiseCopyableCheck::Implicit};
62
63
63
64
if (nominal->hasClangNode () ||
Original file line number Diff line number Diff line change @@ -62,8 +62,7 @@ struct S_Explicit_With_Function_C : _BitwiseCopyable {
62
62
public struct S_Public { }
63
63
64
64
struct 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
67
66
}
68
67
69
68
struct 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