// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details #pragma once #include "Luau/Scope.h" #include "Luau/NotNull.h" #include "Luau/TypeFwd.h" namespace Luau { template struct GeneralizationParams { bool foundOutsideFunctions = false; size_t useCount = 0; Polarity polarity = Polarity::None; }; // Replace a single free type by its bounds according to the polarity provided. std::optional generalizeType( NotNull arena, NotNull builtinTypes, NotNull scope, TypeId freeTy, const GeneralizationParams& params ); // Generalize one type pack std::optional generalizeTypePack( NotNull arena, NotNull builtinTypes, NotNull scope, TypePackId tp, const GeneralizationParams& params ); void sealTable(NotNull scope, TypeId ty); std::optional generalize( NotNull arena, NotNull builtinTypes, NotNull scope, NotNull> cachedTypes, TypeId ty ); }