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() {
39
39
40
40
bool ide::printTypeUSR (Type Ty, raw_ostream &OS) {
41
41
assert (!Ty->hasArchetype () && " cannot have contextless archetypes mangled." );
42
+ Ty = Ty->getCanonicalType ()->getRValueType ();
42
43
Mangle::ASTMangler Mangler (Ty->getASTContext ());
43
- OS << Mangler.mangleTypeAsUSR (Ty-> getRValueType () );
44
+ OS << Mangler.mangleTypeAsUSR (Ty);
44
45
return false ;
45
46
}
46
47
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 [] }
65
65
// CHECK6: <Container>$s21cursor_info_container1EOmD</Container>
66
66
67
67
// 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