Xcode 10.2 beta 2 (10P91b) SourceKit: editor.open syntax tree output does not contain related reference from typealias to associatedtype

Originator:port001
Number:rdar://48144932 Date Originated:
Status: Resolved:
Product: Product Version:
Classification: Reproducible:
 
Summary:

The `source.request.editor.open` request with `key.enablesyntaxtree = 1` response returned by SourceKit in Xcode 10.2 beta2 (10P91b) does not include related references for typealias declarations that define an associatedtype.

In Xcode 10.1 the related reference is present.


Steps to Reproduce:

Given the following code:

```
import Foundation

protocol MyProtocol {
    associatedtype AssociatedType = Void
}

struct MyStruct {}

enum MyEnum: MyProtocol {
    typealias AssociatedType = MyStruct
}
```

Syntax tree output in Xcode 10.2 beta2 does not include a related reference from the `typealias` to the `associatedtype`, as is the case in Xcode 10.1.


Output for 10.2 beta 2 (10P91b): https://gist.github.com/ileitch/8d981f122bab39035d4c785303b03363
Output for 10.1 (10B61): https://gist.github.com/ileitch/2340a1200f3fec0fe15605651f95c8f2


Expected Results:

The `typealias` declaration should include a related reference to the associatedtype, e.g from the Xcode 10.1 output:

```
"key.related" : [
  {
    "key.kind" : "source.lang.swift.ref.associatedtype",
    "key.usr" : "s:17RetentionFixtures10MyProtocolP14AssociatedTypeQa",
    "key.name" : "AssociatedType"
  }
],
```

Actual Results:

The `typealias` declaration does not reference the `associatedtype`.


Version/Build:

Xcode 10.2 beta2 (10P91b)

Configuration:

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!