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
2072
2072
if (outputLang == OutputLanguageMode::Cxx) {
2073
2073
if (!SD->isInstanceMember ())
2074
2074
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);
2078
2079
return ;
2079
2080
}
2080
2081
assert (SD->isInstanceMember () && " static subscripts not supported" );
Original file line number Diff line number Diff line change 16
16
17
17
public struct IntBox { var x : CInt }
18
18
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
+
19
32
public func - ( lhs: IntBox , rhs: IntBox ) -> CInt {
20
33
return lhs. x - rhs. x
21
34
}
You can’t perform that action at this time.
0 commit comments