Here is an example with two GENERICSABLE classes: Foo and Qux.
#import "Foo.h"
#import "Qux.h"
#import <Foundation/Foundation.h>
int main(void)
{
@autoreleasepool {
NSArray<Foo> *fooArray = [NSArray array];
NSString *bar = [fooArray lastObject].bar;
NSArray<Qux> *quxArray = [NSArray array];
NSArray<Foo> *array = [NSArray arrayWithArray:quxArray];
}
}
Well, it doesn't compile
$ clang -Wall -Wextra -c -fobjc-arc main.m
main.m:8:23: warning: incompatible pointer types initializing 'NSArray<Foo> *__strong' with an expression of type 'NSArray<Qux> *' [-Wincompatible-pointer-types]
NSArray<Foo> *fooArray = [NSArray array];
^ ~~~~~~~~~~~~~~~
main.m:9:47: error: property 'bar' not found on object of type 'Qux *'
NSString *bar = [fooArray lastObject].bar;
^
main.m:12:23: warning: incompatible pointer types initializing 'NSArray<Foo> *__strong' with an expression of type 'NSArray<Qux> *' [-Wincompatible-pointer-types]
NSArray<Foo> *array = [NSArray arrayWithArray:quxArray];
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings and 1 error generated.
It seems that the last imported GENERICSABLE class wins.
Here is an example with two GENERICSABLE classes: Foo and Qux.
Well, it doesn't compile
It seems that the last imported GENERICSABLE class wins.