Hang on initialization of recursive generic type
| Originator: | thomas.visser | ||
| Number: | rdar://18072376 | Date Originated: | 20-Aug-2014 08:14 AM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode 6, beta 6 |
| Classification: | Hang | Reproducible: | Always |
Summary:
If a generic class in any way refers to its type from the implementation (e.g. by having a property of the same type or an array of elements of that type), the execution hangs on the creation of this type.
I discovered the issue when my OSS library failed to run after updating to beta 6: https://github.com/Thomvis/BrightFutures/tree/8e280e4554d39bf1eec39b5649cad44e00fb43b5. There is a minimum failing example below.
Steps to Reproduce:
Paste the following in a playground:
```
public class A<T> {
var callbacks: A<T>?
}
let before = "before"
A<Int>()
let after = "after"
```
Expected Results:
I expect the playground to compile and execute completely.
Actual Results:
It does compile, but it seems to hang on the initialization of the A<T> type (`A<Int>()`). You can see this because the `after` constant is never initialized.
Version:
Xcode 6 beta 6
Notes:
This used to work perfectly fine in beta 5
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!