Support for collection subscripting (NSArray and NSDictionary).

Yes, the syntax is ugly, but no doubt people will start using it in June...



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@35033 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
theraven 2012-04-06 12:23:10 +00:00
parent 8ffddbc573
commit ecfd46edb2
7 changed files with 64 additions and 4 deletions

View file

@ -34,6 +34,17 @@ int main()
#endif
obj = [obj objectAtIndex: 0];
PASS([obj isKindOfClass: [NSMutableArray class]] == YES,"array mutable");
START_SET("NSArray subscripting")
# ifndef __has_feature
# define __has_feature(x) 0
# endif
#if __has_feature(objc_subscripting)
NSArray *a = @[ @"foo", @"bar" ];
PASS([@"foo" isEqualToString:a[0]], "Array subscripting works");
# else
SKIP("No collection subscripting support in the compiler.")
# endif
END_SET("NSArray subscripting")
[arp release]; arp = nil;
return 0;
}