Skip to content

Commit 547439e

Browse files
Merge pull request #5394 from swiftwasm/main
[pull] swiftwasm from main
2 parents 2f4ee5f + 6ae1077 commit 547439e

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

lib/Index/Index.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1504,8 +1504,8 @@ bool IndexSwiftASTWalker::reportExtension(ExtensionDecl *D) {
15041504
if (!startEntity(D, Info, /*IsRef=*/false))
15051505
return false;
15061506

1507-
if (!reportRelatedRef(NTD, Loc, /*isImplicit=*/false,
1508-
(SymbolRoleSet)SymbolRole::RelationExtendedBy, D))
1507+
TypeLoc TL(D->getExtendedTypeRepr(), D->getExtendedType());
1508+
if (!reportRelatedTypeRef(TL, (SymbolRoleSet)SymbolRole::RelationExtendedBy, D))
15091509
return false;
15101510
if (!reportInheritedTypeRefs(D->getInherited(), D))
15111511
return false;

test/Index/roles.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,3 +499,13 @@ protocol WithPrimary<Assoc> {
499499
// CHECK: [[@LINE-1]]:18 | type-alias/associated-type/Swift | Assoc | {{.*}} | Def,RelChild | rel: 1
500500
// CHECK-NEXT: RelChild | protocol/Swift | WithPrimary | {{.*}}
501501
}
502+
503+
struct Root {} // CHECK: [[@LINE]]:8 | struct/Swift | Root | [[Root_USR:.*]] | Def | rel: 0
504+
505+
typealias Alias = Root // CHECK: [[@LINE]]:11 | type-alias/Swift | Alias | [[Alias_USR:.*]] | Def | rel: 0
506+
507+
extension Alias {
508+
// CHECK: [[@LINE-1]]:11 | type-alias/Swift | Alias | [[Alias_USR]] | Ref | rel: 0
509+
// CHECK: [[@LINE-2]]:11 | struct/Swift | Root | [[Root_USR]] | Ref,Impl,RelExt | rel: 1
510+
func empty() {}
511+
}

test/SourceKit/Macros/macro_basic.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,4 +277,4 @@ macro anonymousTypes(_: () -> String) = #externalMacro(module: "MacroDefinition"
277277

278278
//##-- Expansion on "fails to typecheck" macro expression
279279
// RUN: %sourcekitd-test -req=refactoring.expand.macro -pos=61:2 %s -- ${COMPILER_ARGS[@]} | %FileCheck -check-prefix=ERRONEOUS_EXPAND %s
280-
// ERRONEOUS_EXPAND: 61:1-61:18 (@__swiftmacro_9MacroUser6assertfMf_.swift) "assert("foobar")"
280+
// ERRONEOUS_EXPAND: 61:1-61:18 (@__swiftmacro_{{.+}}.swift) "assert("foobar")"

0 commit comments

Comments
 (0)