Skip to content

Commit f89f28c

Browse files
committed
Intermediate variable
1 parent 40016d5 commit f89f28c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/Sema/TypeCheckType.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,9 +1063,10 @@ static Type diagnoseUnknownType(TypeResolution resolution,
10631063
AbstractFunctionDecl *methodDecl = dc->getInnermostMethodContext();
10641064
bool declaringMethod = methodDecl &&
10651065
methodDecl->getDeclContext() == dc->getParentForLookup();
1066+
bool isPropertyOfClass = insideClass &&
1067+
options.is(TypeResolverContext::PatternBindingDecl);
10661068

1067-
if (((!insideClass || !declaringMethod) && !(insideClass &&
1068-
options.is(TypeResolverContext::PatternBindingDecl)) &&
1069+
if (((!insideClass || !declaringMethod) && !isPropertyOfClass &&
10691070
!options.is(TypeResolverContext::GenericRequirement)) ||
10701071
options.is(TypeResolverContext::ExplicitCastExpr)) {
10711072
Type SelfType = nominal->getSelfInterfaceType();

0 commit comments

Comments
 (0)