File tree Expand file tree Collapse file tree 3 files changed +25
-2
lines changed
test/Interop/SwiftToCxx/unsupported Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,16 @@ class IRABIDetailsProviderImpl {
135
135
if (silFuncType->getLanguage () != SILFunctionLanguage::Swift)
136
136
return None;
137
137
138
+ // FIXME: Tuple parameter mapping support.
139
+ llvm::SmallVector<const ParamDecl *, 8 > silParamMapping;
140
+ for (auto param : *fd->getParameters ()) {
141
+ if (auto *tuple =
142
+ param->getType ()->getDesugaredType ()->getAs <TupleType>()) {
143
+ if (tuple->getNumElements () > 0 )
144
+ return None;
145
+ }
146
+ }
147
+
138
148
auto funcPointerKind =
139
149
FunctionPointerKind (FunctionPointerKind::BasicKind::Function);
140
150
Original file line number Diff line number Diff line change @@ -208,8 +208,9 @@ class CFunctionSignatureTypePrinter
208
208
ClangRepresentation visitTupleType (TupleType *TT,
209
209
Optional<OptionalTypeKind> optionalKind,
210
210
bool isInOutParam) {
211
- assert (TT->getNumElements () == 0 );
212
- // FIXME: Handle non-void type.
211
+ if (TT->getNumElements () > 0 )
212
+ // FIXME: Handle non-void type.
213
+ return ClangRepresentation::unsupported;
213
214
os << " void" ;
214
215
return ClangRepresentation::representable;
215
216
}
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %target-swift-frontend %s -typecheck -module-name Functions -clang-header-expose-public-decls -emit-clang-header-path %t/functions.h
3
+ // RUN: %FileCheck %s < %t/functions.h
4
+
5
+ // RUN: %check-interop-cxx-header-in-clang(%t/functions.h)
6
+
7
+ // CHECK: takesFloat
8
+ // CHECK-NOT: takesTuple
9
+
10
+ public func takesFloat( _ x: Float ) { }
11
+
12
+ public func takesTuple( _ x: ( Float , Float ) ) { }
You can’t perform that action at this time.
0 commit comments