File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Expand file tree Collapse file tree 3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -39,8 +39,9 @@ static inline StringRef getUSRSpacePrefix() {
3939
4040bool ide::printTypeUSR (Type Ty, raw_ostream &OS) {
4141 assert (!Ty->hasArchetype () && " cannot have contextless archetypes mangled." );
42+ Ty = Ty->getCanonicalType ()->getRValueType ();
4243 Mangle::ASTMangler Mangler (Ty->getASTContext ());
43- OS << Mangler.mangleTypeAsUSR (Ty-> getRValueType () );
44+ OS << Mangler.mangleTypeAsUSR (Ty);
4445 return false ;
4546}
4647
Original file line number Diff line number Diff line change 1+ @resultBuilder struct Builder {
2+ static func buildBlock< T> ( _ x: T ) -> T { x }
3+ }
4+
5+ struct S { }
6+
7+ struct R < T> {
8+ init ( @Builder fn: ( ) -> T ) { }
9+ }
10+
11+ // rdar://141168628 - Make sure we can compute the USR here without crashing.
12+ R {
13+ S ( )
14+ // RUN: %sourcekitd-test -req=conformingmethods -pos %(line + 1):2 %s -- %s | %FileCheck %s
15+ }
16+ // CHECK: key.typeusr: "$s13rdar1411686281RVyAA1SVGD"
Original file line number Diff line number Diff line change @@ -65,4 +65,4 @@ func SArrayGen() -> [S] { return [] }
6565// CHECK6: <Container>$s21cursor_info_container1EOmD</Container>
6666
6767// RUN: %sourcekitd-test -req=cursor -pos=37:22 %s -- %s | %FileCheck -check-prefix=CHECK7 %s
68- // CHECK7: <Container>$s21cursor_info_container1SVXSaD </Container>
68+ // CHECK7: <Container>$sSay21cursor_info_container1SVGD </Container>
You can’t perform that action at this time.
0 commit comments