Skip to content

Commit 66e637c

Browse files
committed
AST: Change TypeBase::addCurriedSelfType() to use the self type not declared type
In a protocol, the overload signature type of a property is (Self) -> (), not (Proto) -> ().
1 parent bc3baaa commit 66e637c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lib/AST/Type.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ Type TypeBase::addCurriedSelfType(const DeclContext *dc) {
439439
genericFn->getExtInfo());
440440
}
441441

442-
auto selfTy = dc->getDeclaredInterfaceType();
442+
auto selfTy = dc->getSelfInterfaceType();
443443
auto selfParam = AnyFunctionType::Param(selfTy);
444444
if (sig)
445445
return GenericFunctionType::get(sig, {selfParam}, type);

test/IDE/complete_value_expr.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1851,12 +1851,11 @@ func testDeDuped(_ x: dedupS) {
18511851
x#^PROTOCOL_EXT_DEDUP_1^#
18521852
// FIXME: Should produce 3 items (?)
18531853
1854-
// PROTOCOL_EXT_DEDUP_1: Begin completions, 6 items
1854+
// PROTOCOL_EXT_DEDUP_1: Begin completions, 5 items
18551855
// PROTOCOL_EXT_DEDUP_1: Decl[InstanceMethod]/CurrNominal: .foo()[#Int#]; name=foo()
18561856
// PROTOCOL_EXT_DEDUP_1: Decl[InstanceVar]/CurrNominal: .bar[#Int#]; name=bar
18571857
// PROTOCOL_EXT_DEDUP_1: Decl[Subscript]/CurrNominal: [{#Int#}][#Int#]; name=[Int]
18581858
// PROTOCOL_EXT_DEDUP_1: Decl[InstanceVar]/Super: .bar[#Int#]; name=bar
1859-
// PROTOCOL_EXT_DEDUP_1: Decl[Subscript]/Super: [{#Self.T#}][#Self.T#]; name=[Self.T]
18601859
// PROTOCOL_EXT_DEDUP_1: Keyword[self]/CurrNominal: .self[#dedupS#]; name=self
18611860
// PROTOCOL_EXT_DEDUP_1: End completions
18621861
}

0 commit comments

Comments
 (0)