Fix build on Clang 12 by removing unused variables (#195)

This commit is contained in:
LoganDark 2021-11-11 06:29:59 -08:00 committed by GitHub
parent 68fb2bdfde
commit a6a2b86c9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 10 deletions

View File

@ -496,7 +496,7 @@ static bool canSuggestInferredType(ScopePtr scope, TypeId ty)
return false;
// No syntax for unnamed tables with a metatable
if (const MetatableTypeVar* mtv = get<MetatableTypeVar>(ty))
if (get<MetatableTypeVar>(ty))
return false;
if (const TableTypeVar* ttv = get<TableTypeVar>(ty))
@ -688,7 +688,7 @@ static std::optional<bool> functionIsExpectedAt(const Module& module, AstNode* n
TypeId expectedType = follow(*it);
if (const FunctionTypeVar* ftv = get<FunctionTypeVar>(expectedType))
if (get<FunctionTypeVar>(expectedType))
return true;
if (const IntersectionTypeVar* itv = get<IntersectionTypeVar>(expectedType))

View File

@ -2129,7 +2129,7 @@ TypeId TypeChecker::checkRelationalOperation(
if (!isNonstrictMode() && !isOrOp)
return ty;
if (auto i = get<UnionTypeVar>(ty))
if (get<UnionTypeVar>(ty))
{
std::optional<TypeId> cleaned = tryStripUnionFromNil(ty);

View File

@ -216,7 +216,7 @@ bool finite(TypePackId tp)
if (auto pack = get<TypePack>(tp))
return pack->tail ? finite(*pack->tail) : true;
if (auto pack = get<VariadicTypePack>(tp))
if (get<VariadicTypePack>(tp))
return false;
return true;

View File

@ -749,9 +749,9 @@ void StateDot::visitChild(TypeId ty, int parentIndex, const char* linkName)
if (opts.duplicatePrimitives && canDuplicatePrimitive(ty))
{
if (const PrimitiveTypeVar* ptv = get<PrimitiveTypeVar>(ty))
if (get<PrimitiveTypeVar>(ty))
formatAppend(result, "n%d [label=\"%s\"];\n", index, toStringDetailed(ty, {}).name.c_str());
else if (const AnyTypeVar* atv = get<AnyTypeVar>(ty))
else if (get<AnyTypeVar>(ty))
formatAppend(result, "n%d [label=\"any\"];\n", index);
}
else
@ -902,19 +902,19 @@ void StateDot::visitChildren(TypeId ty, int index)
finishNodeLabel(ty);
finishNode();
}
else if (const AnyTypeVar* atv = get<AnyTypeVar>(ty))
else if (get<AnyTypeVar>(ty))
{
formatAppend(result, "AnyTypeVar %d", index);
finishNodeLabel(ty);
finishNode();
}
else if (const PrimitiveTypeVar* ptv = get<PrimitiveTypeVar>(ty))
else if (get<PrimitiveTypeVar>(ty))
{
formatAppend(result, "PrimitiveTypeVar %s", toStringDetailed(ty, {}).name.c_str());
finishNodeLabel(ty);
finishNode();
}
else if (const ErrorTypeVar* etv = get<ErrorTypeVar>(ty))
else if (get<ErrorTypeVar>(ty))
{
formatAppend(result, "ErrorTypeVar %d", index);
finishNodeLabel(ty);
@ -994,7 +994,7 @@ void StateDot::visitChildren(TypePackId tp, int index)
finishNodeLabel(tp);
finishNode();
}
else if (const Unifiable::Error* etp = get<Unifiable::Error>(tp))
else if (get<Unifiable::Error>(tp))
{
formatAppend(result, "ErrorTypePack %d", index);
finishNodeLabel(tp);