Try following NOUGAT codes:
public static class Program
{
public Int32 Main(String[] args)
{
Test(new List1<int>()); // ok
Test(new List2<int>());
// ok for COOPER/ECHOES, but compile error for NOUGAT:
// Parameter 1 is "List2<Foundation.NSNumber<Int32>>", should be "ISequence<T>"
}
public void Test<T>(ISequence<T> seq){
}
}
public __mapped class List1<T> : ISequence<T> => Foundation.NSMutableArray
{
}
public __mapped class List2<T> => Foundation.NSMutableArray
{
}
I have two questions:
- What does the interface implementation syntax here mean? I think a mapped class can’t implement other interfaces.
- Why can’t List2 convert to ISequence implicitly on NOUGAT, but works on COOPER/ECHOES by mapping to ArrayList/List?