Bug 23766 – Mixin template should support core.attribute:selector

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Mac OS X
Creation time
2023-03-08T11:36:46Z
Last change time
2024-12-13T19:27:39Z
Assigned to
No Owner
Creator
Marcelo Silva Nascimento Mancini
Moved to GitHub: dmd#18155 →

Comments

Comment #0 by msnmancini — 2023-03-08T11:36:46Z
I understand about not supporting selector for templates. But mixin template should not even be considered template as it only inserts the code where it is. Objective c has a bind boilerplate code while defining the alloc/init, and it can even be simplified by using the following mixin: ```d mixin template ObjectiveCOpCall() { extern(Objective-C) override static typeof(this) alloc() @selector("alloc") extern(Objective-C) override typeof(this) init() @selector("init"); extern(D) final static typeof(this) opCall(){return alloc.init;} } extern(Objective-C): extern class NSObject { static NSObject alloc() @selector("alloc"); NSObject init() @selector("init"); } extern class MTLRenderPassColorDescriptor : NSObject { mixin ObjectiveCOpCall(); } ```
Comment #1 by robert.schadek — 2024-12-13T19:27:39Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18155 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB