mirror of
https://github.com/luau-lang/luau.git
synced 2024-12-13 05:20:38 +00:00
26 lines
854 B
C
26 lines
854 B
C
|
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
||
|
#pragma once
|
||
|
|
||
|
#include "Luau/TypeVar.h"
|
||
|
|
||
|
#include <unordered_map>
|
||
|
|
||
|
namespace Luau
|
||
|
{
|
||
|
|
||
|
// Only exposed so they can be unit tested.
|
||
|
using SeenTypes = std::unordered_map<TypeId, TypeId>;
|
||
|
using SeenTypePacks = std::unordered_map<TypePackId, TypePackId>;
|
||
|
|
||
|
struct CloneState
|
||
|
{
|
||
|
int recursionCount = 0;
|
||
|
bool encounteredFreeType = false;
|
||
|
};
|
||
|
|
||
|
TypePackId clone(TypePackId tp, TypeArena& dest, SeenTypes& seenTypes, SeenTypePacks& seenTypePacks, CloneState& cloneState);
|
||
|
TypeId clone(TypeId tp, TypeArena& dest, SeenTypes& seenTypes, SeenTypePacks& seenTypePacks, CloneState& cloneState);
|
||
|
TypeFun clone(const TypeFun& typeFun, TypeArena& dest, SeenTypes& seenTypes, SeenTypePacks& seenTypePacks, CloneState& cloneState);
|
||
|
|
||
|
} // namespace Luau
|