Xcode-beta (8W109m): Compilation fails due to related protocols

Originator:GriotSpeak
Number:rdar://30248571 Date Originated:28-Jan-2017 10:03 AM
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode-beta (8W109m)
Classification:Serious Bug Reproducible:Always
 
Summary:
The attached project does not build with Swift 3.1. MusicVector and MusicMagnitude reference each other (Vectors have Magnitude and Magnitudes can be extracted from Vectors) and, as far as I can tell, this cyclical relationship is causing an issue with compilation where Magnitude is not seen as an associatedType on Vector.

Steps to Reproduce:
Build the attached project with Xcode beta 8.3

Expected Results:
Successful build.

Actual Results:
Build fails with the message that `'Self' does not have a member type named 'Magnitude'; did you mean 'Iterator’?` etc

Regression:
Does not occur with Xcode 8.2.1 (Swift 3.0.1)

Notes:
Provide additional information, such as references to related problems, workarounds and relevant attachments.

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!