mirror of
https://github.com/luau-lang/luau.git
synced 2024-12-14 06:00:39 +00:00
f7d8ad0774
Also adjust benchmark runs to use config=profile and run clang for all benchmarks + gcc for runtime
64 lines
1.3 KiB
C++
64 lines
1.3 KiB
C++
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
|
|
|
#include "Luau/ApplyTypeFunction.h"
|
|
|
|
LUAU_FASTFLAG(LuauClassTypeVarsInSubstitution)
|
|
|
|
namespace Luau
|
|
{
|
|
|
|
bool ApplyTypeFunction::isDirty(TypeId ty)
|
|
{
|
|
if (typeArguments.count(ty))
|
|
return true;
|
|
else if (const FreeTypeVar* ftv = get<FreeTypeVar>(ty))
|
|
{
|
|
if (ftv->forwardedTypeAlias)
|
|
encounteredForwardedType = true;
|
|
return false;
|
|
}
|
|
else
|
|
return false;
|
|
}
|
|
|
|
bool ApplyTypeFunction::isDirty(TypePackId tp)
|
|
{
|
|
if (typePackArguments.count(tp))
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
|
|
bool ApplyTypeFunction::ignoreChildren(TypeId ty)
|
|
{
|
|
if (get<GenericTypeVar>(ty))
|
|
return true;
|
|
else if (FFlag::LuauClassTypeVarsInSubstitution && get<ClassTypeVar>(ty))
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
|
|
bool ApplyTypeFunction::ignoreChildren(TypePackId tp)
|
|
{
|
|
if (get<GenericTypePack>(tp))
|
|
return true;
|
|
else
|
|
return false;
|
|
}
|
|
|
|
TypeId ApplyTypeFunction::clean(TypeId ty)
|
|
{
|
|
TypeId& arg = typeArguments[ty];
|
|
LUAU_ASSERT(arg);
|
|
return arg;
|
|
}
|
|
|
|
TypePackId ApplyTypeFunction::clean(TypePackId tp)
|
|
{
|
|
TypePackId& arg = typePackArguments[tp];
|
|
LUAU_ASSERT(arg);
|
|
return arg;
|
|
}
|
|
|
|
} // namespace Luau
|