Compiler bug: XCTAssertEqualObjects plus NSArray literal

Number:rdar://38299852 Date Originated:March 9 2018, 1:21 PM
Status:Open Resolved:
Product:Xcode Product Version:9.2 (9C40b)
Classification:Serious Bug Reproducible:Always
Passing `NSArray` literal inside `XCTAssertEqualObjects` causes compile error, whereas passing stack variable from same literal does not.

Steps to Reproduce:
Open enclosed Xcode project

Expected Results:
    XCTAssertEqualObjects(array, [self methodTakingArray:@[ @"hello", @"world" ]]);
should compile the same as:
    NSArray *array = @[ @"hello", @"world" ];
    XCTAssertEqualObjects(array, [self methodTakingArray:array]);

Actual Results:
The former succeeds where the latter fails.

Xcode 9.2 (9C40b)

macOS 10.13.3


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!