Compiling the code below with -Osize should trigger a segfault (or assertion failure). It can be worked around by forcing the type of "resource" to be Optional.
I tried to dig in to the code for this. As far as I could see the error occurs in the Outliner pass in -Osize, where ti's is creating an outline for the Obj-C method call for bundle.path(forResource:ofType🙂. Both of its parameters take Optional<String> (or Optional<NSString>) but it generates a non-optional String parameter type and it causes a type mismatch.
ChristopherRogers commentedApr 13, 2018
Environment
Xcode 9.3, Swift 4.1
Swift 4.2 master (5ea4848)
Additional Detail from JIRA
md5: 9dfe97cde2c14b3c4990b74e565d74af
Issue Description:
Compiling the code below with -Osize should trigger a segfault (or assertion failure). It can be worked around by forcing the type of "resource" to be Optional.
I tried to dig in to the code for this. As far as I could see the error occurs in the Outliner pass in -Osize, where ti's is creating an outline for the Obj-C method call for bundle.path(forResource:ofType🙂 . Both of its parameters take Optional<String> (or Optional<NSString>) but it generates a non-optional String parameter type and it causes a type mismatch.
The text was updated successfully, but these errors were encountered: