Swift compiler: segfault when code is in different modules

Originator:leonid.s.usov
Number:rdar://24540413 Date Originated:2016-07-02
Status:Open Resolved:
Product:XCode Product Version:7.2.1 (7C1002)
Classification:Swift Compiler Crash Reproducible:Always
 
Summary:
There is a segfault during project building when particularly written two declarations cross referencing each other are in different compilation units (in different files). The same code builds and runs well when the declarations are in one file.

Steps to Reproduce:
1. Create any swift based project
2. Add the two attached files to the project
3. Build
4. See Result
5. Move the code from one of the files to another
6. Build
7. See Result

Expected Results:
* The compiler must not crash
* The code should compile equally disregarding how it is distributed across files

Actual Results:
The compiler segfaults - observed at step 4 above - when the two classes are in separate files
The code compiles well when both declarations are in the same file

Version:
XCode 7.2.1 (7C1002)
OSX 10.11.3

Notes:


Configuration:
default new iOS 9.2 project


Attachments:
'Two.swift' and 'One.swift' were successfully uploaded.


One.swift >>>
class A<T: P> {
    typealias X = T.TA
}
<<<

Two.swift >>>
protocol P: class {
    var a: A<Self> {get}
    typealias TA
}
<<<

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!