Files
swift-mirror/test/SourceKit/CursorInfo/rdar_34348776.swift
Rintaro Ishizaki 7c7a7ab47c [ASTMangler] Allow to mangle any generic decl type
More specifically, generic `typealias` type.
For instance:

    typealias Pair<T, T> = (T, T)
    typealias PairAlias = Pair

Interface type of `PairAlias` is `Pair.Type`, not `(T, T).Type`
Fixes crash in sourcekit cursorinfo.

rdar://problem/34348776
2018-04-19 18:10:25 +09:00

14 lines
731 B
Swift

public struct MyStruct<T> {}
public typealias Alias<T> = MyStruct<T>
public typealias Aliased = Alias
// RUN: %sourcekitd-test -req=cursor -pos=3:18 %s -- %s | %FileCheck %s
// CHECK: source.lang.swift.decl.typealias (3:18-3:25)
// CHECK-NEXT: Aliased
// CHECK-NEXT: s:13rdar_343487767Aliaseda
// CHECK-NEXT: Alias.Type
// CHECK-NEXT: $S13rdar_343487765AliasamD
// CHECK-NEXT: <Declaration>public typealias Aliased = <Type usr="s:13rdar_343487765Aliasa">Alias</Type></Declaration>
// CHECK-NEXT: <decl.typealias><syntaxtype.keyword>public</syntaxtype.keyword> <syntaxtype.keyword>typealias</syntaxtype.keyword> <decl.name>Aliased</decl.name> = <ref.typealias usr="s:13rdar_343487765Aliasa">Alias</ref.typealias></decl.typealias>