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 @@ -2072,9 +2072,10 @@ class DeclAndTypePrinter::Implementation
20722072 if (outputLang == OutputLanguageMode::Cxx) {
20732073 if (!SD->isInstanceMember ())
20742074 return ;
2075- auto *getter = SD->getOpaqueAccessor (AccessorKind::Get);
2076- printAbstractFunctionAsMethod (getter, false ,
2077- /* isNSUIntegerSubscript=*/ false , SD);
2075+ // TODO: support read accessors.
2076+ if (auto *getter = SD->getOpaqueAccessor (AccessorKind::Get))
2077+ printAbstractFunctionAsMethod (getter, false ,
2078+ /* isNSUIntegerSubscript=*/ false , SD);
20782079 return ;
20792080 }
20802081 assert (SD->isInstanceMember () && " static subscripts not supported" );
Original file line number Diff line number Diff line change 1616
1717public struct IntBox { var x : CInt }
1818
19+ public struct CustomArray < Element> where Element : ~ Copyable {
20+ private var buffer : UnsafeMutableBufferPointer < Element >
21+
22+ public subscript( index: Int ) -> Element {
23+ _read {
24+ yield buffer [ index]
25+ }
26+ nonmutating _modify {
27+ yield & buffer[ index]
28+ }
29+ }
30+ }
31+
1932public func - ( lhs: IntBox , rhs: IntBox ) -> CInt {
2033 return lhs. x - rhs. x
2134}
You can’t perform that action at this time.
0 commit comments