Not even sure if it started with Xcode 15 RC, but that's when I found it. I believe that in Xcode 14 and all before it objective-c literal @-1 was interpreted correctly as NSNumber -1. Not with Xcode 15 RC, when I use @-1 in the objective-c array as:
_types = @{
@-2:[[CircleWaypointType alloc] init],
@-1:[[PolygonPointWaypointType alloc] init],
@-2 is interpreted correctly, but @-1 is not:
(lldb) po _types
{
18446744073709551615 = "<PolygonPointWaypointType: 0x2802fa840>";
"-2" = "<CircleWaypointType: 0x2802fa7c0>";
}
The array type is NSDictionary<NSNumber*, WaypointType*> *types, so the interpreter/compiler should not have a problem with the type of the literal, I think.
Reported to Apple under FB13181573.
It's possible that this only happens when @-1 is used in the array, I have not had time to explore/test more. Reporting here, so you would not be hit by this pretty obscure thing.
Workaround was obvious, using [NSNumber numberWithInt:-1] works as intended.