Skip to content

Commit 83b7dc2

Browse files
jacob-carlborgdlang-bot
authored andcommitted
Add missing @selector for Objective-C methods
1 parent a4274b3 commit 83b7dc2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

test/compilable/objc_class.d

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ extern (Objective-C) extern class NSObject
1919
// Declaring a root class with a method with a body
2020
extern(Objective-C) class Test
2121
{
22-
void foo() {}
22+
void foo() @selector("foo") {}
2323
}

test/dshell/extra-files/cpp_header_gen/library.d

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
module library;
22

3+
version (D_ObjectiveC)
4+
import core.attribute : selector;
5+
36
extern (C++):
47

58
int foo(ref const S s)
@@ -113,7 +116,8 @@ extern(C++) class VTable
113116
{
114117
extern(D) int hidden_1() { return 1; }
115118
int callable_2() { return 2; }
116-
extern(Objective-C) int hidden_3() { return 3; }
119+
version (D_ObjectiveC)
120+
extern(Objective-C) int hidden_3() @selector("hidden_3") { return 3; }
117121
int callable_4() { return 4; }
118122
extern(D) final int hidden_5() { return 5; }
119123
int callable_6() { return 6; }

0 commit comments

Comments
 (0)