From 40016d52847342edec6d28f4d0ba764062301eaa Mon Sep 17 00:00:00 2001 From: John Holdsworth Date: Fri, 22 Mar 2019 18:01:52 +0000 Subject: [PATCH] Don't exclude Self on properties of Value types. --- lib/Sema/TypeCheckType.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Sema/TypeCheckType.cpp b/lib/Sema/TypeCheckType.cpp index 6c0781e3ee56b..68dbadac23cc8 100644 --- a/lib/Sema/TypeCheckType.cpp +++ b/lib/Sema/TypeCheckType.cpp @@ -1064,9 +1064,9 @@ static Type diagnoseUnknownType(TypeResolution resolution, bool declaringMethod = methodDecl && methodDecl->getDeclContext() == dc->getParentForLookup(); - if (((!insideClass || !declaringMethod) && - !options.is(TypeResolverContext::GenericRequirement) && - !options.is(TypeResolverContext::PatternBindingDecl)) || + if (((!insideClass || !declaringMethod) && !(insideClass && + options.is(TypeResolverContext::PatternBindingDecl)) && + !options.is(TypeResolverContext::GenericRequirement)) || options.is(TypeResolverContext::ExplicitCastExpr)) { Type SelfType = nominal->getSelfInterfaceType(); if (insideClass)