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> {
755755 void printType (Type T) { printTypeWithOptions (T, Options); }
756756
757757 void printTransformedTypeWithOptions (Type T, PrintOptions options) {
758- if (CurrentType && Current) {
758+ if (CurrentType && Current && CurrentType-> mayHaveMembers () ) {
759759 if (T->hasArchetype ()) {
760760 // Get the interface type, since TypeLocs still have
761761 // contextual types in them.
Original file line number Diff line number Diff line change @@ -19,6 +19,17 @@ class MyType<T> {
1919 }
2020}
2121
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+
2233// RUN: %sourcekitd-test -req=cursor -pos=1:10 %s -- %s | %FileCheck -check-prefix=CHECK1 %s
2334// CHECK1: <Declaration>func testGenerics<T>(x: <Type usr="s:15cursor_generics12testGenerics1xyx_tlF1TL_xmfp">T</Type>)</Declaration>
2435
@@ -37,3 +48,7 @@ class MyType<T> {
3748// RUN: %sourcekitd-test -req=cursor -pos=18:14 %s -- %s | %FileCheck -check-prefix=CHECK5 %s
3849// CHECK5: source.lang.swift.ref.var.instance
3950// 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