Skip to content

Commit faca489

Browse files
martinboehmezoecarver
authored andcommitted
Add a test that Objective-C types passed to a C++ constructor are
bridged correctly.
1 parent 1ce3753 commit faca489

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#import <Foundation.h>
2+
3+
struct ConstructorWithNSArrayParam {
4+
ConstructorWithNSArrayParam(NSArray *array) {}
5+
};

test/Interop/Cxx/class/Inputs/module.modulemap

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ module Constructors {
1010
header "constructors.h"
1111
}
1212

13+
module ConstructorsObjC {
14+
header "constructors-objc.h"
15+
}
16+
17+
module LoadableTypes {
18+
header "loadable-types.h"
19+
}
20+
1321
module MemberwiseInitializer {
1422
header "memberwise-initializer.h"
1523
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Test that Objective-C types passed to a C++ constructor are bridged
2+
// correctly.
3+
4+
// RUN: %target-swift-ide-test(mock-sdk: %clang-importer-sdk) -print-module -module-to-print=ConstructorsObjC -I %S/Inputs/ -source-filename=x -enable-cxx-interop | %FileCheck %s
5+
6+
// REQUIRES: objc_interop
7+
8+
// CHECK: struct ConstructorWithNSArrayParam {
9+
// CHECK-NEXT: init(_ array: [Any]!)
10+
// CHECK-NEXT: }

0 commit comments

Comments
 (0)