File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
test/SourceKit/CursorInfo Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -755,7 +755,7 @@ class PrintAST : public ASTVisitor<PrintAST> {
755
755
void printType (Type T) { printTypeWithOptions (T, Options); }
756
756
757
757
void printTransformedTypeWithOptions (Type T, PrintOptions options) {
758
- if (CurrentType && Current) {
758
+ if (CurrentType && Current && CurrentType-> mayHaveMembers () ) {
759
759
if (T->hasArchetype ()) {
760
760
// Get the interface type, since TypeLocs still have
761
761
// contextual types in them.
Original file line number Diff line number Diff line change @@ -19,6 +19,17 @@ class MyType<T> {
19
19
}
20
20
}
21
21
22
+ // rdar://76750555
23
+ public protocol IP {
24
+ init ( networkBytes: Int )
25
+ }
26
+
27
+ public struct HostRecord < IPType: IP > {
28
+ func foo( ) {
29
+ let ipType = IPType ( networkBytes: 42 )
30
+ }
31
+ }
32
+
22
33
// RUN: %sourcekitd-test -req=cursor -pos=1:10 %s -- %s | %FileCheck -check-prefix=CHECK1 %s
23
34
// CHECK1: <Declaration>func testGenerics<T>(x: <Type usr="s:15cursor_generics12testGenerics1xyx_tlF1TL_xmfp">T</Type>)</Declaration>
24
35
@@ -37,3 +48,7 @@ class MyType<T> {
37
48
// RUN: %sourcekitd-test -req=cursor -pos=18:14 %s -- %s | %FileCheck -check-prefix=CHECK5 %s
38
49
// CHECK5: source.lang.swift.ref.var.instance
39
50
// CHECK5: <Declaration>let items: [<Type usr="s:Si">Int</Type>]</Declaration>
51
+
52
+ // RUN: %sourcekitd-test -req=cursor -pos=29:22 %s -- %s | %FileCheck -check-prefix=CHECK_IP_TYPE %s
53
+ // CHECK_IP_TYPE: source.lang.swift.ref.generic_type_param
54
+ // CHECK_IP_TYPE: <Declaration>IPType : <Type usr="s:15cursor_generics2IPP">IP</Type></Declaration>
You can’t perform that action at this time.
0 commit comments