* InterfaceGen reports a primary associated type as a reference to the
'associatedtype' declaration
* CursorInfo on a primary associated type returns information of the
'associatedtype' declaration
rdar://93275458
Since 9ba892c we always transform `CurrentType` in `ASTPrinter` to be an interface type.
This causes issues when the variable type is a generic parameter type. Previously we had `CurrentType` set to a `PrimaryArchetypeType`. With the fix in d93ae06, we are mapping the archetype out of context to a `GenericParamType`. A `GenericParamType`, however, can’t have members, so we’re hitting an assertion when creating a `TypeTransformContext`. Since the entire type transformation in `printTransformedTypeWithOptions` is only affecting type members, we should be able to safely skip over the transformation if `CurrentType` can’t have any members.
Fixes rdar://76750555 [SR-14497]
For example:
class Foo<T> {
let test: Bool = false
let items: [Int] = []
func foo() {
if test {} // crashes on test
for i in items {} // crashes on items
}
}
We were picking up the incorrect containing type (Bool rather than Foo<T>).
Resolves rdar://problem/36871908.
Unless you're familiar with the way the swift source code is organized,
it's not clear what "SourceDocInfo" means, or how it is different from
DocSupport, etc. Move the tests into directories that are named based
on their request (note: we already had one test under CursorInfo, which
just made things even more confusing).