luau/Analysis/src/Unifiable.cpp

87 lines
1.9 KiB
C++
Raw Normal View History

// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
#include "Luau/Unifiable.h"
2022-10-07 00:55:58 +01:00
LUAU_FASTFLAG(LuauTypeNormalization2);
namespace Luau
{
namespace Unifiable
{
2022-10-07 00:55:58 +01:00
static int nextIndex = 0;
Free::Free(TypeLevel level)
2022-10-07 00:55:58 +01:00
: index(FFlag::LuauTypeNormalization2 ? ++nextIndex : ++DEPRECATED_nextIndex)
, level(level)
{
}
2022-07-29 04:41:13 +01:00
Free::Free(Scope* scope)
2022-10-07 00:55:58 +01:00
: index(FFlag::LuauTypeNormalization2 ? ++nextIndex : ++DEPRECATED_nextIndex)
2022-09-02 00:00:14 +01:00
, scope(scope)
2022-06-03 21:32:20 +01:00
{
}
2022-09-29 23:11:54 +01:00
Free::Free(Scope* scope, TypeLevel level)
2022-10-07 00:55:58 +01:00
: index(FFlag::LuauTypeNormalization2 ? ++nextIndex : ++DEPRECATED_nextIndex)
2022-09-29 23:11:54 +01:00
, level(level)
, scope(scope)
{
}
2022-10-07 00:55:58 +01:00
int Free::DEPRECATED_nextIndex = 0;
Generic::Generic()
2022-10-07 00:55:58 +01:00
: index(FFlag::LuauTypeNormalization2 ? ++nextIndex : ++DEPRECATED_nextIndex)
, name("g" + std::to_string(index))
{
}
Generic::Generic(TypeLevel level)
2022-10-07 00:55:58 +01:00
: index(FFlag::LuauTypeNormalization2 ? ++nextIndex : ++DEPRECATED_nextIndex)
, level(level)
, name("g" + std::to_string(index))
{
}
Generic::Generic(const Name& name)
2022-10-07 00:55:58 +01:00
: index(FFlag::LuauTypeNormalization2 ? ++nextIndex : ++DEPRECATED_nextIndex)
, name(name)
, explicitName(true)
{
}
2022-07-29 04:41:13 +01:00
Generic::Generic(Scope* scope)
2022-10-07 00:55:58 +01:00
: index(FFlag::LuauTypeNormalization2 ? ++nextIndex : ++DEPRECATED_nextIndex)
2022-06-03 21:32:20 +01:00
, scope(scope)
{
}
Generic::Generic(TypeLevel level, const Name& name)
2022-10-07 00:55:58 +01:00
: index(FFlag::LuauTypeNormalization2 ? ++nextIndex : ++DEPRECATED_nextIndex)
, level(level)
, name(name)
, explicitName(true)
{
}
2022-07-29 04:41:13 +01:00
Generic::Generic(Scope* scope, const Name& name)
2022-10-07 00:55:58 +01:00
: index(FFlag::LuauTypeNormalization2 ? ++nextIndex : ++DEPRECATED_nextIndex)
2022-06-24 02:44:07 +01:00
, scope(scope)
, name(name)
, explicitName(true)
{
}
2022-10-07 00:55:58 +01:00
int Generic::DEPRECATED_nextIndex = 0;
Error::Error()
: index(++nextIndex)
{
}
int Error::nextIndex = 0;
} // namespace Unifiable
} // namespace Luau