Skip to content

Commit 75bff92

Browse files
committed
IDE: fix printTypeInterface
The missing module was causing not only a crash in conformance lookup, but full qualification for a generic parameter, which shouldn't ever be needed.
1 parent 8125e60 commit 75bff92

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

lib/IDE/ModuleInterfacePrinting.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ printTypeInterface(ModuleDecl *M, Type Ty, ASTPrinter &Printer,
177177
PrintOptions Options = PrintOptions::printTypeInterface(
178178
Ty.getPointer(),
179179
Ty->getASTContext().TypeCheckerOpts.PrintFullConvention);
180+
Options.CurrentModule = M;
180181
ND->print(Printer, Options);
181182
printTypeNameToString(Ty, TypeName);
182183
return false;

test/IDE/print_type_interface.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ extension D {
5454
public func unconditionalFunc2(t : T) -> T {return t}
5555
}
5656

57-
// TYPE2: public class D<print_type_interface.T1> {
57+
// TYPE2: public class D<T1> {
5858
// TYPE2: public func foo()
5959
// TYPE2: public func conditionalFunc1()
60-
// TYPE2: public func conditionalFunc2(t: print_type_interface.T1) -> print_type_interface.T1
60+
// TYPE2: public func conditionalFunc2(t: T1) -> T1
6161
// TYPE2: public func unconditionalFunc1()
62-
// TYPE2: public func unconditionalFunc2(t: print_type_interface.T1) -> print_type_interface.T1
62+
// TYPE2: public func unconditionalFunc2(t: T1) -> T1
6363
// TYPE2: }
6464

6565
// TYPE3: public class D<Int> {

test/SourceKit/InterfaceGen/gen_swift_type.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ struct S1 {
3838
// CHECK3: public func fea1()
3939
// CHECK3: public func fea2()
4040

41-
// CHECK4: public struct Array<gen_swift_type.A>
41+
// CHECK4: public struct Array<A>
4242

4343
public protocol P1 { }
4444
public class T1 : P1 { }
@@ -63,12 +63,12 @@ extension D {
6363
public func unconditionalFunc2(t : T) -> T {return t}
6464
}
6565

66-
// CHECK5: public class D<gen_swift_type.T1> {
66+
// CHECK5: public class D<T1> {
6767
// CHECK5: public func foo()
6868
// CHECK5: public func conditionalFunc1()
69-
// CHECK5: public func conditionalFunc2(t: gen_swift_type.T1) -> gen_swift_type.T1
69+
// CHECK5: public func conditionalFunc2(t: T1) -> T1
7070
// CHECK5: public func unconditionalFunc1()
71-
// CHECK5: public func unconditionalFunc2(t: gen_swift_type.T1) -> gen_swift_type.T1
71+
// CHECK5: public func unconditionalFunc2(t: T1) -> T1
7272

7373
// CHECK6: public class D<Int> {
7474
// CHECK6: public func foo()

0 commit comments

Comments
 (0)