mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 05:00:16 +03:00
Objective-C classes do not have invariants, null check directly.
This commit is contained in:
parent
2aa9f23110
commit
0845895659
1 changed files with 3 additions and 2 deletions
|
@ -57,15 +57,16 @@ void main()
|
||||||
{
|
{
|
||||||
// Basic alloc & init
|
// Basic alloc & init
|
||||||
auto obj = NSObject.alloc.init;
|
auto obj = NSObject.alloc.init;
|
||||||
assert(obj);
|
assert(obj !is null);
|
||||||
|
|
||||||
// Basic property
|
// Basic property
|
||||||
auto cname = obj.className();
|
auto cname = obj.className();
|
||||||
assert(cname);
|
assert(cname !is null);
|
||||||
assert(cname.UTF8String());
|
assert(cname.UTF8String());
|
||||||
|
|
||||||
// Properties
|
// Properties
|
||||||
obj = MyClass.alloc().init();
|
obj = MyClass.alloc().init();
|
||||||
|
assert(obj !is null);
|
||||||
assert(validateMethod(obj, "isFourtyTwo")); // Case: isXYZ
|
assert(validateMethod(obj, "isFourtyTwo")); // Case: isXYZ
|
||||||
assert(validateMethod(obj, "setFourtyTwo:")); // Case: isXYZ
|
assert(validateMethod(obj, "setFourtyTwo:")); // Case: isXYZ
|
||||||
assert(validateMethod(obj, "myFunction:b:c:")); // Case: Auto-gen function selector.
|
assert(validateMethod(obj, "myFunction:b:c:")); // Case: Auto-gen function selector.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue