Generated code for types in intent definition files causes build warnings

Originator:daniel
Number:rdar://FB9197900 Date Originated:2021-06-21
Status:Open Resolved:
Product:Xcode Product Version:13.0 beta (13A5154h)
Classification: Reproducible:always
 
Please describe the issue:
The generated Swift code for types in .intentdefinition files causes build warnings about unnecessary casts. Since the generated code files are managed by Xcode and automatically overwritten, this can't be fixed on the app developer's end.

Please list the steps you took to reproduce the issue:
Open and build the attached sample project, or follow these steps:

1. Create a new iOS app project
2. Add a new SiriKit Intent Definition file
3. Add a new type to the .intentdefinition file
4. Build

What did you expect to happen?
There should be no build warnings.

What actually happened?
The warning "Forced cast of 'Self' to same type has no effect" is shown three times for the generated Swift file (see attached screenshot).

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com 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!