File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed
test/Interop/SwiftToCxx/functions Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -2069,9 +2069,10 @@ class DeclAndTypePrinter::Implementation
2069
2069
if (outputLang == OutputLanguageMode::Cxx) {
2070
2070
if (!SD->isInstanceMember ())
2071
2071
return ;
2072
- auto *getter = SD->getOpaqueAccessor (AccessorKind::Get);
2073
- printAbstractFunctionAsMethod (getter, false ,
2074
- /* isNSUIntegerSubscript=*/ false , SD);
2072
+ // TODO: support read accessors.
2073
+ if (auto *getter = SD->getOpaqueAccessor (AccessorKind::Get))
2074
+ printAbstractFunctionAsMethod (getter, false ,
2075
+ /* isNSUIntegerSubscript=*/ false , SD);
2075
2076
return ;
2076
2077
}
2077
2078
assert (SD->isInstanceMember () && " static subscripts not supported" );
Original file line number Diff line number Diff line change @@ -25,6 +25,19 @@ public struct IntBox {
25
25
}
26
26
}
27
27
28
+ public struct CustomArray < Element> where Element : ~ Copyable {
29
+ private var buffer : UnsafeMutableBufferPointer < Element >
30
+
31
+ public subscript( index: Int ) -> Element {
32
+ _read {
33
+ yield buffer [ index]
34
+ }
35
+ nonmutating _modify {
36
+ yield & buffer[ index]
37
+ }
38
+ }
39
+ }
40
+
28
41
// CHECK: #if __cplusplus >= 202302L
29
42
// CHECK-NEXT: SWIFT_INLINE_THUNK int operator [](int x, int _2) const SWIFT_SYMBOL("s:9Operators6IntBoxVys5Int32VAE_AEtcig");
30
43
// CHECK-NEXT: #endif // #if __cplusplus >= 202302L
You can’t perform that action at this time.
0 commit comments