2021-10-29 16:25:12 -04: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-06 20:23:29 -04:00
|
|
|
static int nextIndex = 0;
|
|
|
|
|
2023-03-17 15:20:37 -04:00
|
|
|
int freshIndex()
|
|
|
|
{
|
|
|
|
return ++nextIndex;
|
|
|
|
}
|
|
|
|
|
2021-10-29 16:25:12 -04:00
|
|
|
Free::Free(TypeLevel level)
|
2023-01-20 15:27:03 -05:00
|
|
|
: index(++nextIndex)
|
2021-10-29 16:25:12 -04:00
|
|
|
, level(level)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-07-29 00:24:07 -04:00
|
|
|
Free::Free(Scope* scope)
|
2023-01-20 15:27:03 -05:00
|
|
|
: index(++nextIndex)
|
2022-09-01 19:14:03 -04:00
|
|
|
, scope(scope)
|
2022-06-03 18:15:45 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-09-29 18:23:10 -04:00
|
|
|
Free::Free(Scope* scope, TypeLevel level)
|
2023-01-20 15:27:03 -05:00
|
|
|
: index(++nextIndex)
|
2022-09-29 18:23:10 -04:00
|
|
|
, level(level)
|
|
|
|
, scope(scope)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-10-06 20:23:29 -04:00
|
|
|
int Free::DEPRECATED_nextIndex = 0;
|
2021-10-29 16:25:12 -04:00
|
|
|
|
|
|
|
Generic::Generic()
|
2023-01-20 15:27:03 -05:00
|
|
|
: index(++nextIndex)
|
2021-10-29 16:25:12 -04:00
|
|
|
, name("g" + std::to_string(index))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Generic::Generic(TypeLevel level)
|
2023-01-20 15:27:03 -05:00
|
|
|
: index(++nextIndex)
|
2021-10-29 16:25:12 -04:00
|
|
|
, level(level)
|
|
|
|
, name("g" + std::to_string(index))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Generic::Generic(const Name& name)
|
2023-01-20 15:27:03 -05:00
|
|
|
: index(++nextIndex)
|
2021-10-29 16:25:12 -04:00
|
|
|
, name(name)
|
|
|
|
, explicitName(true)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-07-29 00:24:07 -04:00
|
|
|
Generic::Generic(Scope* scope)
|
2023-01-20 15:27:03 -05:00
|
|
|
: index(++nextIndex)
|
2022-06-03 18:15:45 -04:00
|
|
|
, scope(scope)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-10-29 16:25:12 -04:00
|
|
|
Generic::Generic(TypeLevel level, const Name& name)
|
2023-01-20 15:27:03 -05:00
|
|
|
: index(++nextIndex)
|
2021-10-29 16:25:12 -04:00
|
|
|
, level(level)
|
|
|
|
, name(name)
|
|
|
|
, explicitName(true)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-07-29 00:24:07 -04:00
|
|
|
Generic::Generic(Scope* scope, const Name& name)
|
2023-01-20 15:27:03 -05:00
|
|
|
: index(++nextIndex)
|
2022-06-23 21:56:00 -04:00
|
|
|
, scope(scope)
|
|
|
|
, name(name)
|
|
|
|
, explicitName(true)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-10-06 20:23:29 -04:00
|
|
|
int Generic::DEPRECATED_nextIndex = 0;
|
2021-10-29 16:25:12 -04:00
|
|
|
|
|
|
|
Error::Error()
|
|
|
|
: index(++nextIndex)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
int Error::nextIndex = 0;
|
|
|
|
|
|
|
|
} // namespace Unifiable
|
|
|
|
} // namespace Luau
|