Skip to content

Commit fdbfba3

Browse files
authored
Merge pull request #16160 from slavapestov/typo-correction-tweak
Add typo correction test case that was fixed, and skip accessors in lookup
2 parents 472da9e + d4a7f3f commit fdbfba3

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

lib/AST/LookupVisibleDecls.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ static bool areTypeDeclsVisibleInLookupMode(LookupState LS) {
124124
static bool isDeclVisibleInLookupMode(ValueDecl *Member, LookupState LS,
125125
const DeclContext *FromContext,
126126
LazyResolver *TypeResolver) {
127+
// Accessors are never visible directly in the source language.
128+
if (isa<AccessorDecl>(Member))
129+
return false;
130+
127131
if (TypeResolver) {
128132
TypeResolver->resolveDeclSignature(Member);
129133
TypeResolver->resolveAccessControl(Member);

test/Sema/typo_correction.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,15 @@ func test_overloaded() {
144144
overloadd(0)
145145
// expected-error@-1 {{use of unresolved identifier 'overloadd'; did you mean 'overloaded'?}}{{3-12=overloaded}}
146146
}
147+
148+
// This is one of the backtraces from rdar://36434823 but got fixed along
149+
// the way.
150+
class CircularValidationWithTypo {
151+
var cdcdcdcd = ababab { // expected-error {{use of unresolved identifier 'ababab'}}
152+
didSet { }
153+
}
154+
155+
var abababab = cdcdcdc { // expected-error {{use of unresolved identifier 'cdcdcdc'}}
156+
didSet { }
157+
}
158+
}

0 commit comments

Comments
 (0)