dmd/compiler/test/runnable/objc_call_static.d
2022-07-09 18:53:07 +02:00

24 lines
533 B
D

// EXTRA_OBJC_SOURCES:
// REQUIRED_ARGS: -L-framework -LFoundation
import core.attribute : selector;
extern (Objective-C)
extern class NSObject
{
static NSObject alloc() @selector("alloc");
static NSObject allocWithZone(void* zone) @selector("allocWithZone:");
NSObject init() @selector("init");
}
void main()
{
auto obj1 = NSObject.alloc();
auto obj2 = NSObject.allocWithZone(null);
auto obj3 = NSObject.alloc().init();
assert(obj1 !is null);
assert(obj2 !is null);
assert(obj3 !is null);
}