Skip to content

Clean up warnings #15086

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions lib/AST/GenericSignatureBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3288,7 +3288,7 @@ void RewriteTreeNode::mergeIntoRec(
for (auto child : children)
child->mergeIntoRec(other, matchPath);

if (auto assocType = getMatch())
if (getMatch())
matchPath.pop_back();
}

Expand Down Expand Up @@ -3646,8 +3646,6 @@ static Type substituteConcreteType(GenericSignatureBuilder &builder,
proto, parentType, ProtocolConformanceRef(proto));

type = type.subst(subMap, SubstFlags::UseErrorType);
if (!type)
return ErrorType::get(proto->getASTContext());
} else {
// Substitute in the superclass type.
auto superclass = basePA->getEquivalenceClassIfPresent()->superclass;
Expand Down
2 changes: 1 addition & 1 deletion lib/IDE/CodeCompletion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4024,7 +4024,7 @@ class CompletionLookup final : public swift::VisibleDeclConsumer {
}

return getPositionInTupleExpr(DC, CCExpr, tuple, Position, HasName);
} else if (auto *paren = dyn_cast<ParenExpr>(CallE->getArg())) {
} else if (isa<ParenExpr>(CallE->getArg())) {
HasName = false;
Position = 0;
return true;
Expand Down
2 changes: 1 addition & 1 deletion lib/IRGen/LoadableByAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ static bool containsFunctionSignature(GenericEnvironment *genEnv,
if (auto optionalObject = objectType.getOptionalObjectType()) {
objectType = optionalObject;
}
if (auto fnType = objectType.getAs<SILFunctionType>()) {
if (objectType.is<SILFunctionType>()) {
return true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/SIL/InstructionUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ FindClosureResult swift::findClosureForAppliedArg(SILValue V) {
if (auto *bbi = dyn_cast<BeginBorrowInst>(V))
V = bbi->getOperand();

if (auto optionalObjTy = V->getType().getOptionalObjectType())
if (V->getType().getOptionalObjectType())
V = cast<EnumInst>(V)->getOperand();

auto fnType = V->getType().getAs<SILFunctionType>();
Expand Down
2 changes: 1 addition & 1 deletion lib/SILOptimizer/Mandatory/DiagnoseStaticExclusivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ static void checkNoEscapePartialApply(PartialApplyInst *PAI) {
uses.append(EI->getUses().begin(), EI->getUses().end());
continue;
}
if (auto apply = isa<ApplySite>(user)) {
if (isa<ApplySite>(user)) {
SILValue arg = oper->get();
auto ArgumentFnType = getSILFunctionTypeForValue(arg);
if (ArgumentFnType && ArgumentFnType->isNoEscape()) {
Expand Down