Skip to content

Commit 0e2e315

Browse files
committed
Remember nominal type decls for member lookup
`lookupVisibleMemberDecls` visits nominal type decls to find visible members of the type. Remembering what decls are visited can be useful information for the clients. * Add a 'VisibleDeclConsumer' callback function that is called when 'lookupVisibleDecls' visits each nominal type decls * Remember the decl names in 'CodeCompletionContext' for future use
1 parent 0fc5ba1 commit 0e2e315

File tree

9 files changed

+200
-32
lines changed

9 files changed

+200
-32
lines changed

include/swift/AST/NameLookup.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,10 @@ class VisibleDeclConsumer {
374374
public:
375375
virtual ~VisibleDeclConsumer() = default;
376376

377+
/// This method is called every time it look for members from a decl.
378+
virtual void onLookupNominalTypeMembers(NominalTypeDecl *NTD,
379+
DeclVisibilityKind Reason) {}
380+
377381
/// This method is called by findVisibleDecls() every time it finds a decl.
378382
virtual void foundDecl(ValueDecl *VD, DeclVisibilityKind Reason,
379383
DynamicLookupInfo dynamicLookupInfo = {}) = 0;
@@ -420,6 +424,11 @@ class AccessFilteringDeclConsumer final : public VisibleDeclConsumer {
420424
VisibleDeclConsumer &consumer)
421425
: DC(DC), ChainedConsumer(consumer) {}
422426

427+
void onLookupNominalTypeMembers(NominalTypeDecl *NTD,
428+
DeclVisibilityKind Reason) override {
429+
ChainedConsumer.onLookupNominalTypeMembers(NTD, Reason);
430+
}
431+
423432
void foundDecl(ValueDecl *D, DeclVisibilityKind reason,
424433
DynamicLookupInfo dynamicLookupInfo = {}) override;
425434
};
@@ -441,6 +450,11 @@ class UsableFilteringDeclConsumer final : public VisibleDeclConsumer {
441450
: SM(SM), DC(DC), typeContext(DC->getInnermostTypeContext()), Loc(loc),
442451
ChainedConsumer(consumer) {}
443452

453+
void onLookupNominalTypeMembers(NominalTypeDecl *NTD,
454+
DeclVisibilityKind Reason) override {
455+
ChainedConsumer.onLookupNominalTypeMembers(NTD, Reason);
456+
}
457+
444458
void foundDecl(ValueDecl *D, DeclVisibilityKind reason,
445459
DynamicLookupInfo dynamicLookupInfo) override;
446460
};

include/swift/IDE/CodeCompletionContext.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ class CodeCompletionContext {
3131
CodeCompletionCache &Cache;
3232
CompletionKind CodeCompletionKind = CompletionKind::None;
3333

34+
/// Module qualified nominal type decl names
35+
SmallVector<NullTerminatedStringRef, 2> LookedupNominalTypeNames;
36+
3437
enum class TypeContextKind {
3538
/// There is no known contextual type. All types are equally good.
3639
None,

include/swift/IDE/CompletionLookup.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,9 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
498498
void foundDecl(ValueDecl *D, DeclVisibilityKind Reason,
499499
DynamicLookupInfo dynamicLookupInfo) override;
500500

501+
void onLookupNominalTypeMembers(NominalTypeDecl *NTD,
502+
DeclVisibilityKind Reason) override;
503+
501504
bool handleEnumElement(ValueDecl *D, DeclVisibilityKind Reason,
502505
DynamicLookupInfo dynamicLookupInfo);
503506

lib/IDE/CompletionLookup.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1881,6 +1881,20 @@ bool CompletionLookup::addCompoundFunctionNameIfDesiable(
18811881
return true;
18821882
}
18831883

1884+
void CompletionLookup::onLookupNominalTypeMembers(NominalTypeDecl *NTD,
1885+
DeclVisibilityKind Reason) {
1886+
1887+
// Remember the decl name to
1888+
SmallString<32> buffer;
1889+
llvm::raw_svector_ostream OS(buffer);
1890+
PrintOptions PS = PrintOptions::printDocInterface();
1891+
PS.FullyQualifiedTypes = true;
1892+
NTD->getDeclaredType()->print(OS, PS);
1893+
NullTerminatedStringRef qualifiedName(
1894+
buffer, *CompletionContext->getResultSink().Allocator);
1895+
CompletionContext->LookedupNominalTypeNames.push_back(qualifiedName);
1896+
}
1897+
18841898
void CompletionLookup::foundDecl(ValueDecl *D, DeclVisibilityKind Reason,
18851899
DynamicLookupInfo dynamicLookupInfo) {
18861900
assert(Reason !=

lib/Sema/LookupVisibleDecls.cpp

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,8 @@ static void lookupTypeMembers(Type BaseType, Type LookupType,
273273
NominalTypeDecl *D = LookupType->getAnyNominal();
274274
assert(D && "should have a nominal type");
275275

276+
Consumer.onLookupNominalTypeMembers(D, Reason);
277+
276278
SmallVector<ValueDecl*, 2> FoundDecls;
277279
collectVisibleMemberDecls(CurrDC, LS, BaseType, D, FoundDecls);
278280

@@ -464,6 +466,9 @@ static void lookupDeclsFromProtocolsBeingConformedTo(
464466

465467
if (auto NormalConformance = dyn_cast<NormalProtocolConformance>(
466468
Conformance->getRootConformance())) {
469+
470+
Consumer.onLookupNominalTypeMembers(Proto, ReasonForThisProtocol);
471+
467472
for (auto Member : Proto->getMembers()) {
468473
// Skip associated types and value requirements that aren't visible
469474
// or have a corresponding witness.
@@ -545,13 +550,13 @@ static void
545550
if (!Visited.insert(PD).second)
546551
return;
547552

553+
lookupTypeMembers(BaseTy, PD->getDeclaredInterfaceType(), Consumer, CurrDC,
554+
LS, Reason);
555+
556+
// Collect members from the inherited protocols.
548557
for (auto Proto : PD->getInheritedProtocols())
549-
lookupVisibleProtocolMemberDecls(BaseTy, Proto,
550-
Consumer, CurrDC, LS,
551-
getReasonForSuper(Reason),
552-
Sig, Visited);
553-
lookupTypeMembers(BaseTy, PD->getDeclaredInterfaceType(),
554-
Consumer, CurrDC, LS, Reason);
558+
lookupVisibleProtocolMemberDecls(BaseTy, Proto, Consumer, CurrDC, LS,
559+
getReasonForSuper(Reason), Sig, Visited);
555560
}
556561

557562
// Generate '$' and '_' prefixed variables for members that have attached property
@@ -862,6 +867,8 @@ namespace {
862867

863868
class OverrideFilteringConsumer : public VisibleDeclConsumer {
864869
public:
870+
llvm::SmallVector<std::pair<NominalTypeDecl *, DeclVisibilityKind>, 2>
871+
nominals;
865872
llvm::SetVector<FoundDeclTy> Results;
866873
llvm::SmallVector<ValueDecl *, 8> Decls;
867874
llvm::SetVector<FoundDeclTy> FilteredResults;
@@ -876,6 +883,11 @@ class OverrideFilteringConsumer : public VisibleDeclConsumer {
876883
assert(DC && BaseTy);
877884
}
878885

886+
void onLookupNominalTypeMembers(NominalTypeDecl *NTD,
887+
DeclVisibilityKind Reason) override {
888+
nominals.emplace_back(NTD, Reason);
889+
}
890+
879891
void foundDecl(ValueDecl *VD, DeclVisibilityKind Reason,
880892
DynamicLookupInfo dynamicLookupInfo) override {
881893
if (!Results.insert({VD, Reason, dynamicLookupInfo}))
@@ -886,6 +898,10 @@ class OverrideFilteringConsumer : public VisibleDeclConsumer {
886898
}
887899

888900
void filterDecls(VisibleDeclConsumer &Consumer) {
901+
for (auto nominal : nominals) {
902+
Consumer.onLookupNominalTypeMembers(nominal.first, nominal.second);
903+
}
904+
889905
removeOverriddenDecls(Decls);
890906
removeShadowedDecls(Decls, DC);
891907

@@ -1042,6 +1058,11 @@ struct KeyPathDynamicMemberConsumer : public VisibleDeclConsumer {
10421058
!seenStaticBaseName(VD->getBaseName());
10431059
}
10441060

1061+
void onLookupNominalTypeMembers(NominalTypeDecl *NTD,
1062+
DeclVisibilityKind Reason) override {
1063+
consumer.onLookupNominalTypeMembers(NTD, Reason);
1064+
}
1065+
10451066
void foundDecl(ValueDecl *VD, DeclVisibilityKind reason,
10461067
DynamicLookupInfo dynamicLookupInfo) override {
10471068
assert(dynamicLookupInfo.getKind() !=
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-ide-test -batch-code-completion -source-filename %s -filecheck %raw-FileCheck -completion-output-dir %t -module-name "Mod"
3+
4+
protocol BaseP1 {}
5+
protocol BaseP2 {}
6+
7+
func testBasicArchetype(arg: some BaseP1) {
8+
arg.#^TestBaseP1^#
9+
// TestBaseP1: LookedupTypeNames: ['Mod.BaseP1']
10+
}
11+
12+
13+
protocol DerivedP1: BaseP1 {}
14+
protocol DerivedP2: BaseP2 {}
15+
protocol DerivedPComp: BaseP1, BaseP2 {}
16+
17+
func testInheritedArchetype(arg: some DerivedP1) {
18+
arg.#^TestDerivedP1^#
19+
// TestDerivedP1: LookedupTypeNames: ['Mod.DerivedP1', 'Mod.BaseP1']
20+
}
21+
22+
func testMultiInheritedArchetype(arg: some DerivedPComp) {
23+
arg.#^TestDerivedPComp^#
24+
// TestDerivedPComp: LookedupTypeNames: ['Mod.DerivedPComp', 'Mod.BaseP1', 'Mod.BaseP2']
25+
}
26+
27+
func testCompositionArchetype(arg: some BaseP1 & BaseP2) {
28+
arg.#^TestBaseP1AndBaseP2^#
29+
// TestBaseP1AndBaseP2: LookedupTypeNames: ['Mod.BaseP1', 'Mod.BaseP2']
30+
}
31+
32+
protocol DiamondRoot {}
33+
protocol DiamondEdge1: DiamondRoot {}
34+
protocol DiamondEdge2: DiamondRoot {}
35+
protocol DiamondTop: DiamondEdge1, DiamondEdge2 {}
36+
37+
func testDiamondProtocol(arg: some DiamondTop) {
38+
arg.#^TestDiamondTop^#
39+
// TestDiamondTop: LookedupTypeNames: ['Mod.DiamondTop', 'Mod.DiamondEdge1', 'Mod.DiamondRoot', 'Mod.DiamondEdge2']
40+
}
41+
42+
func testExistential(arg: any DiamondTop) {
43+
arg.#^TestAnyDiamondTop^#
44+
// TestAnyDiamondTop: LookedupTypeNames: ['Mod.DiamondTop', 'Mod.DiamondEdge1', 'Mod.DiamondRoot', 'Mod.DiamondEdge2']
45+
}
46+
47+
class BaseClass {}
48+
class DerivedClass: BaseClass {}
49+
50+
func testBasicClass(arg: BaseClass) {
51+
arg.#^TestBaseClass^#
52+
// TestBaseClass: LookedupTypeNames: ['Mod.BaseClass']
53+
}
54+
55+
func testSubClass(arg: DerivedClass) {
56+
arg.#^TestDerivedClass^#
57+
// TestDerivedClass: LookedupTypeNames: ['Mod.DerivedClass', 'Mod.BaseClass']
58+
}
59+
60+
protocol BaseClassConstrainedP: BaseClass {}
61+
protocol DerivedClassConstrainedP: DerivedClass {}
62+
63+
func testClassConstrainedProto(arg: some BaseClassConstrainedP) {
64+
arg.#^TestBaseClassConstrainedP^#
65+
// TestBaseClassConstrainedP: LookedupTypeNames: ['Mod.BaseClassConstrainedP', 'Mod.BaseClass']
66+
}
67+
func testClassConstriainedProto2(arg: some DerivedClassConstrainedP) {
68+
arg.#^TestDerivedClassConstrainedP^#
69+
// TestDerivedClassConstrainedP: LookedupTypeNames: ['Mod.DerivedClassConstrainedP', 'Mod.DerivedClass', 'Mod.BaseClass']
70+
}
71+
72+
class BaseClassWithProto: BaseP1 {}
73+
class DerivedClassWithProto: BaseClassWithProto, BaseP2 {}
74+
75+
func testBaseClassWithProto(arg: BaseClassWithProto) {
76+
arg.#^TestBaseClassWithProto^#
77+
// TestBaseClassWithProto: LookedupTypeNames: ['Mod.BaseClassWithProto', 'Mod.BaseP1']
78+
}
79+
80+
func testDerivedClassWithProto(arg: DerivedClassWithProto) {
81+
arg.#^TestDerivedClassWithProto^#
82+
// TestDerivedClassWithProto: LookedupTypeNames: ['Mod.DerivedClassWithProto', 'Mod.BaseP2', 'Mod.BaseP1', 'Mod.BaseClassWithProto']
83+
}
84+
85+
struct GenericS<T> {}
86+
extension GenericS: BaseP1 where T == Int {}
87+
88+
func testConditionalConformanceNo(arg: GenericS<String>) {
89+
arg.#^TestConditionalConformanceNo^#
90+
// TestConditionalConformanceNo: LookedupTypeNames: ['Mod.GenericS']
91+
}
92+
93+
func testConditionalConformanceYes(arg: GenericS<Int>) {
94+
arg.#^TestConditionalConformanceYes^#
95+
// TestConditionalConformanceYes: LookedupTypeNames: ['Mod.GenericS', 'Mod.BaseP1']
96+
}

test/IDE/complete_type.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ typealias FooTypealias = Int
5252
// WITH_GLOBAL_TYPES_EXPR-DAG: Decl[TypeAlias]/CurrModule: FooTypealias[#Int#]{{; name=.+$}}
5353
// WITH_GLOBAL_TYPES_EXPR: End completions
5454

55-
// GLOBAL_NEGATIVE-NOT: fooObject
56-
// GLOBAL_NEGATIVE-NOT: fooFunc
57-
58-
// WITHOUT_GLOBAL_TYPES-NOT: FooStruct
59-
// WITHOUT_GLOBAL_TYPES-NOT: FooEnum
60-
// WITHOUT_GLOBAL_TYPES-NOT: FooClass
61-
// WITHOUT_GLOBAL_TYPES-NOT: FooProtocol
62-
// WITHOUT_GLOBAL_TYPES-NOT: FooTypealias
55+
// GLOBAL_NEGATIVE-NOT: Decl.*: fooObject
56+
// GLOBAL_NEGATIVE-NOT: Decl.*: fooFunc
57+
58+
// WITHOUT_GLOBAL_TYPES-NOT: Decl.*: FooStruct
59+
// WITHOUT_GLOBAL_TYPES-NOT: Decl.*: FooEnum
60+
// WITHOUT_GLOBAL_TYPES-NOT: Decl.*: FooClass
61+
// WITHOUT_GLOBAL_TYPES-NOT: Decl.*: FooProtocol
62+
// WITHOUT_GLOBAL_TYPES-NOT: Decl.*: FooTypealias
6363

6464
// ERROR_COMMON: found code completion token
6565
// ERROR_COMMON-NOT: Begin completions

test/IDE/complete_value_expr.swift

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -756,16 +756,16 @@ func testLookInProtoNoDot2() {
756756
func testLookInProtoNoDot3() {
757757
fooExBarExProtocolInstance#^PROTO_MEMBERS_NO_DOT_3^#
758758
// PROTO_MEMBERS_NO_DOT_3: Begin completions
759+
// PROTO_MEMBERS_NO_DOT_3-NEXT: Decl[InstanceMethod]/CurrNominal: .barExInstanceFunc0()[#Double#]{{; name=.+$}}
759760
// PROTO_MEMBERS_NO_DOT_3-NEXT: Decl[InstanceVar]/Super: .barInstanceVar[#Int#]{{; name=.+$}}
760761
// PROTO_MEMBERS_NO_DOT_3-NEXT: Decl[InstanceMethod]/Super: .barInstanceFunc0()[#Double#]{{; name=.+$}}
761762
// PROTO_MEMBERS_NO_DOT_3-NEXT: Decl[InstanceMethod]/Super: .barInstanceFunc1({#(a): Int#})[#Double#]{{; name=.+$}}
762-
// PROTO_MEMBERS_NO_DOT_3-NEXT: Decl[InstanceMethod]/CurrNominal: .barExInstanceFunc0()[#Double#]{{; name=.+$}}
763+
// PROTO_MEMBERS_NO_DOT_3-NEXT: Decl[InstanceMethod]/CurrNominal: .fooExInstanceFunc0()[#Double#]{{; name=.+$}}
763764
// PROTO_MEMBERS_NO_DOT_3-NEXT: Decl[InstanceVar]/Super: .fooInstanceVar1[#Int#]{{; name=.+$}}
764765
// PROTO_MEMBERS_NO_DOT_3-NEXT: Decl[InstanceVar]/Super: .fooInstanceVar2[#Int#]{{; name=.+$}}
765766
// PROTO_MEMBERS_NO_DOT_3-NEXT: Decl[InstanceMethod]/Super: .fooInstanceFunc0()[#Double#]{{; name=.+$}}
766767
// PROTO_MEMBERS_NO_DOT_3-NEXT: Decl[InstanceMethod]/Super: .fooInstanceFunc1({#(a): Int#})[#Double#]{{; name=.+$}}
767768
// PROTO_MEMBERS_NO_DOT_3-NEXT: Decl[Subscript]/Super: [{#(i): Int#}][#Double#]{{; name=.+$}}
768-
// PROTO_MEMBERS_NO_DOT_3-NEXT: Decl[InstanceMethod]/CurrNominal: .fooExInstanceFunc0()[#Double#]{{; name=.+$}}
769769
// PROTO_MEMBERS_NO_DOT_3-NEXT: Keyword[self]/CurrNominal: .self[#BarExProtocol & FooExProtocol#]; name=self
770770
// PROTO_MEMBERS_NO_DOT_3-NEXT: End completions
771771
}
@@ -799,15 +799,15 @@ func testLookInProto3() {
799799
fooExBarExProtocolInstance.#^PROTO_MEMBERS_3^#
800800
// PROTO_MEMBERS_3: Begin completions
801801
// PROTO_MEMBERS_3-NEXT: Keyword[self]/CurrNominal: self[#BarExProtocol & FooExProtocol#]; name=self
802+
// PROTO_MEMBERS_3-NEXT: Decl[InstanceMethod]/CurrNominal: barExInstanceFunc0()[#Double#]{{; name=.+$}}
802803
// PROTO_MEMBERS_3-NEXT: Decl[InstanceVar]/Super: barInstanceVar[#Int#]{{; name=.+$}}
803804
// PROTO_MEMBERS_3-NEXT: Decl[InstanceMethod]/Super: barInstanceFunc0()[#Double#]{{; name=.+$}}
804805
// PROTO_MEMBERS_3-NEXT: Decl[InstanceMethod]/Super: barInstanceFunc1({#(a): Int#})[#Double#]{{; name=.+$}}
805-
// PROTO_MEMBERS_3-NEXT: Decl[InstanceMethod]/CurrNominal: barExInstanceFunc0()[#Double#]{{; name=.+$}}
806+
// PROTO_MEMBERS_3-NEXT: Decl[InstanceMethod]/CurrNominal: fooExInstanceFunc0()[#Double#]{{; name=.+$}}
806807
// PROTO_MEMBERS_3-NEXT: Decl[InstanceVar]/Super: fooInstanceVar1[#Int#]{{; name=.+$}}
807808
// PROTO_MEMBERS_3-NEXT: Decl[InstanceVar]/Super: fooInstanceVar2[#Int#]{{; name=.+$}}
808809
// PROTO_MEMBERS_3-NEXT: Decl[InstanceMethod]/Super: fooInstanceFunc0()[#Double#]{{; name=.+$}}
809810
// PROTO_MEMBERS_3-NEXT: Decl[InstanceMethod]/Super: fooInstanceFunc1({#(a): Int#})[#Double#]{{; name=.+$}}
810-
// PROTO_MEMBERS_3-NEXT: Decl[InstanceMethod]/CurrNominal: fooExInstanceFunc0()[#Double#]{{; name=.+$}}
811811
// PROTO_MEMBERS_3-NEXT: End completions
812812
}
813813

@@ -861,15 +861,15 @@ func testResolveFuncParam5<FooExBarEx : FooExProtocol & BarExProtocol>(_ a: FooE
861861
a.#^RESOLVE_FUNC_PARAM_5^#
862862
// RESOLVE_FUNC_PARAM_5: Begin completions
863863
// RESOLVE_FUNC_PARAM_5-NEXT: Keyword[self]/CurrNominal: self[#FooExBarEx#]; name=self
864+
// RESOLVE_FUNC_PARAM_5-NEXT: Decl[InstanceMethod]/CurrNominal: barExInstanceFunc0()[#Double#]{{; name=.+$}}
864865
// RESOLVE_FUNC_PARAM_5-NEXT: Decl[InstanceVar]/Super: barInstanceVar[#Int#]{{; name=.+$}}
865866
// RESOLVE_FUNC_PARAM_5-NEXT: Decl[InstanceMethod]/Super: barInstanceFunc0()[#Double#]{{; name=.+$}}
866867
// RESOLVE_FUNC_PARAM_5-NEXT: Decl[InstanceMethod]/Super: barInstanceFunc1({#(a): Int#})[#Double#]{{; name=.+$}}
867-
// RESOLVE_FUNC_PARAM_5-NEXT: Decl[InstanceMethod]/CurrNominal: barExInstanceFunc0()[#Double#]{{; name=.+$}}
868+
// RESOLVE_FUNC_PARAM_5-NEXT: Decl[InstanceMethod]/CurrNominal: fooExInstanceFunc0()[#Double#]{{; name=.+$}}
868869
// RESOLVE_FUNC_PARAM_5-NEXT: Decl[InstanceVar]/Super: fooInstanceVar1[#Int#]{{; name=.+$}}
869870
// RESOLVE_FUNC_PARAM_5-NEXT: Decl[InstanceVar]/Super: fooInstanceVar2[#Int#]{{; name=.+$}}
870871
// RESOLVE_FUNC_PARAM_5-NEXT: Decl[InstanceMethod]/Super: fooInstanceFunc0()[#Double#]{{; name=.+$}}
871872
// RESOLVE_FUNC_PARAM_5-NEXT: Decl[InstanceMethod]/Super: fooInstanceFunc1({#(a): Int#})[#Double#]{{; name=.+$}}
872-
// RESOLVE_FUNC_PARAM_5-NEXT: Decl[InstanceMethod]/CurrNominal: fooExInstanceFunc0()[#Double#]{{; name=.+$}}
873873
// RESOLVE_FUNC_PARAM_5-NEXT: End completions
874874
}
875875

@@ -1311,13 +1311,12 @@ func testProtocol3(_ x: P3) {
13111311
}
13121312
// PROTOCOL_EXT_P3: Begin completions
13131313
1314-
// FIXME: the next two should both be "CurrentNominal"
1315-
// PROTOCOL_EXT_P3-DAG: Decl[InstanceMethod]/Super: reqP1()[#Void#]{{; name=.+$}}
1316-
// PROTOCOL_EXT_P3-DAG: Decl[InstanceMethod]/Super: reqP2()[#Void#]{{; name=.+$}}
1314+
// PROTOCOL_EXT_P3-DAG: Decl[InstanceMethod]/CurrNominal: reqP1()[#Void#]{{; name=.+$}}
1315+
// PROTOCOL_EXT_P3-DAG: Decl[InstanceMethod]/CurrNominal: reqP2()[#Void#]{{; name=.+$}}
1316+
// PROTOCOL_EXT_P3-DAG: Decl[InstanceMethod]/CurrNominal: extP3()[#Void#]{{; name=.+$}}
13171317
13181318
// PROTOCOL_EXT_P3-DAG: Decl[InstanceMethod]/Super: extP1()[#Void#]{{; name=.+$}}
13191319
// PROTOCOL_EXT_P3-DAG: Decl[InstanceMethod]/Super: extP2()[#Void#]{{; name=.+$}}
1320-
// PROTOCOL_EXT_P3-DAG: Decl[InstanceMethod]/CurrNominal: extP3()[#Void#]{{; name=.+$}}
13211320
// PROTOCOL_EXT_P3: End completions
13221321
13231322
func testConformingConcrete1(_ x: WillConformP1) {
@@ -1372,11 +1371,11 @@ func testGenericConforming3<T: P3>(x: T) {
13721371
x.#^PROTOCOL_EXT_GENERICP3^#
13731372
}
13741373
// PROTOCOL_EXT_GENERICP3: Begin completions
1375-
// PROTOCOL_EXT_GENERICP3-DAG: Decl[InstanceMethod]/Super: reqP1()[#Void#]{{; name=.+$}}
1376-
// PROTOCOL_EXT_GENERICP3-DAG: Decl[InstanceMethod]/Super: reqP2()[#Void#]{{; name=.+$}}
1374+
// PROTOCOL_EXT_GENERICP3-DAG: Decl[InstanceMethod]/CurrNominal: reqP1()[#Void#]{{; name=.+$}}
1375+
// PROTOCOL_EXT_GENERICP3-DAG: Decl[InstanceMethod]/CurrNominal: reqP2()[#Void#]{{; name=.+$}}
1376+
// PROTOCOL_EXT_GENERICP3-DAG: Decl[InstanceMethod]/CurrNominal: extP3()[#Void#]{{; name=.+$}}
13771377
// PROTOCOL_EXT_GENERICP3-DAG: Decl[InstanceMethod]/Super: extP1()[#Void#]{{; name=.+$}}
13781378
// PROTOCOL_EXT_GENERICP3-DAG: Decl[InstanceMethod]/Super: extP2()[#Void#]{{; name=.+$}}
1379-
// PROTOCOL_EXT_GENERICP3-DAG: Decl[InstanceMethod]/CurrNominal: extP3()[#Void#]{{; name=.+$}}
13801379
// PROTOCOL_EXT_GENERICP3: End completions
13811380
13821381
protocol NoDupReq1 {
@@ -1483,10 +1482,10 @@ func checkOverrideInclusion2(_ arg: Override3) {
14831482
// CHECK_NODUP_RESTATED_REQ_NODOT: End completions
14841483
14851484
// CHECK_NODUP_RESTATED_REQ_TYPE1: Begin completions, 6 items
1486-
// CHECK_NODUP_RESTATED_REQ_TYPE1: Decl[InstanceMethod]/Super: roo({#(self): NoDupReq6#})[#(arg1: Int) -> Void#]; name=roo(:)
14871485
// CHECK_NODUP_RESTATED_REQ_TYPE1: Decl[InstanceMethod]/CurrNominal: foo({#(self): NoDupReq6#})[#() -> Void#]; name=foo(:)
14881486
// CHECK_NODUP_RESTATED_REQ_TYPE1: Decl[InstanceMethod]/CurrNominal: roo({#(self): NoDupReq6#})[#(arg2: Int) -> Void#]; name=roo(:)
14891487
// CHECK_NODUP_RESTATED_REQ_TYPE1: Decl[AssociatedType]/CurrNominal: E; name=E
1488+
// CHECK_NODUP_RESTATED_REQ_TYPE1: Decl[InstanceMethod]/Super: roo({#(self): NoDupReq6#})[#(arg1: Int) -> Void#]; name=roo(:)
14901489
// CHECK_NODUP_RESTATED_REQ_TYPE1: End completions
14911490
14921491
// CHECK_NODUP_RESTATED_REQ_TYPE2: Begin completions, 6 items
@@ -1503,8 +1502,8 @@ func checkOverrideInclusion2(_ arg: Override3) {
15031502
// CHECK_NODUP_RESTATED_REQ_TYPE3: Decl[InstanceMethod]/CurrNominal: roo({#(self): NoDupReq1 & NoDupReq2 & NoDupReq3#})[#(arg2: Int) -> Void#]; name=roo(:)
15041503
// CHECK_NODUP_RESTATED_REQ_TYPE3: End completions
15051504
1506-
// CHECK_PROT_OVERRIDES: Decl[InstanceMethod]/{{Super|CurrNominal}}: foo({#(arg): NoDupReq1#})[#Void#]; name=foo(:)
1507-
// CHECK_PROT_OVERRIDES: Decl[InstanceMethod]/{{Super|CurrNominal}}: foo({#(arg): NoDupReq2#})[#Void#]; name=foo(:)
1505+
// CHECK_PROT_OVERRIDES-DAG: Decl[InstanceMethod]/{{Super|CurrNominal}}: foo({#(arg): NoDupReq1#})[#Void#]; name=foo(:)
1506+
// CHECK_PROT_OVERRIDES-DAG: Decl[InstanceMethod]/{{Super|CurrNominal}}: foo({#(arg): NoDupReq2#})[#Void#]; name=foo(:)
15081507
15091508
struct OnlyMe {}
15101509
protocol P4 {

0 commit comments

Comments
 (0)