File tree 2 files changed +20
-3
lines changed 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -3385,11 +3385,12 @@ bool BuiltinType::isBitwiseCopyable() const {
3385
3385
return false ;
3386
3386
3387
3387
case BuiltinTypeKind::BuiltinFixedArray: {
3388
- // Bitwise-copyability depends on the element type.
3388
+ // FixedArray<N, X> : BitwiseCopyable whenever X : BitwiseCopyable
3389
3389
auto bfa = cast<BuiltinFixedArrayType>(this );
3390
3390
auto &C = bfa->getASTContext ();
3391
- return (bool )lookupConformance (bfa->getElementType (),
3392
- C.getProtocol (KnownProtocolKind::BitwiseCopyable));
3391
+ return (bool )checkConformance (
3392
+ bfa->getElementType (),
3393
+ C.getProtocol (KnownProtocolKind::BitwiseCopyable));
3393
3394
}
3394
3395
}
3395
3396
}
Original file line number Diff line number Diff line change 1
1
// RUN: %target-typecheck-verify-swift \
2
+ // RUN: -disable-experimental-parser-round-trip \
2
3
// RUN: -disable-availability-checking \
3
4
// RUN: -enable-experimental-feature NonescapableTypes \
5
+ // RUN: -enable-experimental-feature ValueGenerics \
4
6
// RUN: -enable-experimental-feature Sensitive \
5
7
// RUN: -enable-builtin-module \
6
8
// RUN: -debug-diagnostic-names
7
9
10
+ // FIXME: Remove -disable-experimental-parser-round-trip when it's not required for using ValueGenerics.
11
+
8
12
// REQUIRES: swift_feature_NonescapableTypes
13
+ // REQUIRES: swift_feature_ValueGenerics
9
14
// REQUIRES: swift_feature_Sensitive
10
15
11
16
//==============================================================================
@@ -109,6 +114,17 @@ func passS_Implicit_Sensitive(_ s: S_Implicit_Sensitive) {
109
114
// expected-note@-94 {{where_requirement_failure_one_subst}}
110
115
}
111
116
117
+ import Builtin
118
+
119
+ func passFixedArray1N< T> ( _ fa: Builtin . FixedArray < 1 , T> ) {
120
+ take1 ( fa) // expected-error {{type_does_not_conform_decl_owner}}
121
+ // expected-note@-101 {{where_requirement_failure_one_subst}}
122
+ }
123
+
124
+ func passFixedArray1N< T : BitwiseCopyable > ( _ fa: Builtin . FixedArray < 1 , T> ) {
125
+ take1 ( fa)
126
+ }
127
+
112
128
//==============================================================================
113
129
//===========================DEPENDENCY-FREE TESTS=(END)======================}}
114
130
//==============================================================================
You can’t perform that action at this time.
0 commit comments