Skip selector-gen for templates

This commit is contained in:
LunaTheFoxgirl 2024-12-14 17:30:26 +01:00
parent 5df19d9231
commit 8a7108f8c9
2 changed files with 5 additions and 1 deletions

View file

@ -594,6 +594,10 @@ extern(C++) private final class Supported : Objc
return 0;
});
// Avoid attempting to generate selectors for template instances.
if (fd.parent && fd.parent.isTemplateInstance())
return;
// No selector declared, generate one.
if (fd._linkage == LINK.objc && !fd.objc.selector)
{

View file

@ -25,7 +25,7 @@ class MyClass : NSObject
int x;
override static MyClass alloc() => cast(MyClass)super.alloc();
override MyClass init() { x = 42; }
override MyClass init() { x = 42; return this; }
@property bool isFourtyTwo() => x == 42;
@property void isFourtyTwo(bool value) { x = value ? 42 : 0; }