Skip to content

Commit 3a90005

Browse files
committed
Sema: Clean up TypeCheckType.cpp
1 parent 3a01790 commit 3a90005

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

lib/Sema/TypeCheckType.cpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -647,8 +647,6 @@ bool TypeChecker::checkContextualRequirements(GenericTypeDecl *decl,
647647
llvm_unreachable("invalid requirement check type");
648648
}
649649

650-
static void diagnoseUnboundGenericType(Type ty, SourceLoc loc);
651-
652650
/// Apply generic arguments to the given type.
653651
///
654652
/// If the type is itself not generic, this does nothing.
@@ -756,7 +754,8 @@ static Type applyGenericArguments(Type type, TypeResolution resolution,
756754
// Build ParameterizedProtocolType if the protocol has a primary associated
757755
// type and we're in a supported context (for now just generic requirements,
758756
// inheritance clause, extension binding).
759-
if (resolution.getOptions().isConstraintImplicitExistential() && !ctx.LangOpts.hasFeature(Feature::ImplicitSome)) {
757+
if (resolution.getOptions().isConstraintImplicitExistential() &&
758+
!ctx.LangOpts.hasFeature(Feature::ImplicitSome)) {
760759
diags.diagnose(loc, diag::existential_requires_any,
761760
protoDecl->getDeclaredInterfaceType(),
762761
protoDecl->getDeclaredExistentialType(),
@@ -1700,7 +1699,7 @@ static Type resolveNestedIdentTypeComponent(TypeResolution resolution,
17001699
auto DC = resolution.getDeclContext();
17011700
auto &ctx = DC->getASTContext();
17021701
auto &diags = ctx.Diags;
1703-
auto isExtenstionBinding = options.is(TypeResolverContext::ExtensionBinding);
1702+
auto isExtensionBinding = options.is(TypeResolverContext::ExtensionBinding);
17041703

17051704
auto maybeDiagnoseBadMemberType = [&](TypeDecl *member, Type memberType,
17061705
AssociatedTypeDecl *inferredAssocType) {
@@ -1715,13 +1714,13 @@ static Type resolveNestedIdentTypeComponent(TypeResolution resolution,
17151714

17161715
if (options.contains(TypeResolutionFlags::SilenceErrors)) {
17171716
if (TypeChecker::isUnsupportedMemberTypeAccess(
1718-
parentTy, member, hasUnboundOpener, isExtenstionBinding) !=
1717+
parentTy, member, hasUnboundOpener, isExtensionBinding) !=
17191718
TypeChecker::UnsupportedMemberTypeAccessKind::None)
17201719
return ErrorType::get(ctx);
17211720
}
17221721

17231722
switch (TypeChecker::isUnsupportedMemberTypeAccess(
1724-
parentTy, member, hasUnboundOpener, isExtenstionBinding)) {
1723+
parentTy, member, hasUnboundOpener, isExtensionBinding)) {
17251724
case TypeChecker::UnsupportedMemberTypeAccessKind::None:
17261725
break;
17271726

@@ -1910,7 +1909,9 @@ static Type applyNonEscapingIfNecessary(Type ty,
19101909

19111910
// We lost the sugar to flip the isNoEscape bit.
19121911
//
1913-
// FIXME(https://github.com/apple/swift/issues/45125): It would be better to add a new AttributedType sugared type, which would wrap the TypeAliasType or ParenType, and apply the isNoEscape bit when de-sugaring.
1912+
// FIXME(https://github.com/apple/swift/issues/45125): It would be better
1913+
// to add a new AttributedType sugared type, which would wrap the
1914+
// TypeAliasType and apply the isNoEscape bit when de-sugaring.
19141915
return FunctionType::get(funcTy->getParams(), funcTy->getResult(), extInfo);
19151916
}
19161917

@@ -2340,10 +2341,11 @@ NeverNullType TypeResolver::resolveType(TypeRepr *repr,
23402341
return ty;
23412342
};
23422343

2343-
if(getASTContext().LangOpts.hasFeature(Feature::ImplicitSome)){
2344+
if(getASTContext().LangOpts.hasFeature(Feature::ImplicitSome)) {
23442345
if (auto opaqueDecl = dyn_cast<OpaqueTypeDecl>(DC)) {
23452346
if (auto ordinal = opaqueDecl->getAnonymousOpaqueParamOrdinal(repr))
2346-
return diagnoseDisallowedExistential(getIdentityOpaqueTypeArchetypeType(opaqueDecl, *ordinal));
2347+
return diagnoseDisallowedExistential(
2348+
getIdentityOpaqueTypeArchetypeType(opaqueDecl, *ordinal));
23472349
}
23482350
}
23492351

0 commit comments

Comments
 (0)