2021-10-29 21:25:12 +01:00
|
|
|
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
|
|
|
#include "Luau/Unifiable.h"
|
|
|
|
|
|
|
|
namespace Luau
|
|
|
|
{
|
|
|
|
namespace Unifiable
|
|
|
|
{
|
|
|
|
|
2022-10-07 00:55:58 +01:00
|
|
|
static int nextIndex = 0;
|
|
|
|
|
2023-03-17 14:59:30 +00:00
|
|
|
int freshIndex()
|
|
|
|
{
|
|
|
|
return ++nextIndex;
|
|
|
|
}
|
|
|
|
|
2021-10-29 21:25:12 +01:00
|
|
|
Free::Free(TypeLevel level)
|
2023-01-20 12:02:39 +00:00
|
|
|
: index(++nextIndex)
|
2021-10-29 21:25:12 +01:00
|
|
|
, level(level)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-07-29 04:41:13 +01:00
|
|
|
Free::Free(Scope* scope)
|
2023-01-20 12:02:39 +00:00
|
|
|
: index(++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)
|
2023-01-20 12:02:39 +00:00
|
|
|
: index(++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;
|
2021-10-29 21:25:12 +01:00
|
|
|
|
|
|
|
Generic::Generic()
|
2023-01-20 12:02:39 +00:00
|
|
|
: index(++nextIndex)
|
2021-10-29 21:25:12 +01:00
|
|
|
, name("g" + std::to_string(index))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Generic::Generic(TypeLevel level)
|
2023-01-20 12:02:39 +00:00
|
|
|
: index(++nextIndex)
|
2021-10-29 21:25:12 +01:00
|
|
|
, level(level)
|
|
|
|
, name("g" + std::to_string(index))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Generic::Generic(const Name& name)
|
2023-01-20 12:02:39 +00:00
|
|
|
: index(++nextIndex)
|
2021-10-29 21:25:12 +01:00
|
|
|
, name(name)
|
|
|
|
, explicitName(true)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-07-29 04:41:13 +01:00
|
|
|
Generic::Generic(Scope* scope)
|
2023-01-20 12:02:39 +00:00
|
|
|
: index(++nextIndex)
|
2022-06-03 21:32:20 +01:00
|
|
|
, scope(scope)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-10-29 21:25:12 +01:00
|
|
|
Generic::Generic(TypeLevel level, const Name& name)
|
2023-01-20 12:02:39 +00:00
|
|
|
: index(++nextIndex)
|
2021-10-29 21:25:12 +01:00
|
|
|
, level(level)
|
|
|
|
, name(name)
|
|
|
|
, explicitName(true)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-07-29 04:41:13 +01:00
|
|
|
Generic::Generic(Scope* scope, const Name& name)
|
2023-01-20 12:02:39 +00:00
|
|
|
: index(++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;
|
2021-10-29 21:25:12 +01:00
|
|
|
|
|
|
|
Error::Error()
|
|
|
|
: index(++nextIndex)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
int Error::nextIndex = 0;
|
|
|
|
|
|
|
|
} // namespace Unifiable
|
|
|
|
} // namespace Luau
|