// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details #pragma once #include "Luau/Variant.h" #include "Luau/Symbol.h" #include #include namespace Luau { struct Type; using TypeId = const Type*; struct Field; // Deprecated. Do not use in new work. using LValue = Variant; struct Field { std::shared_ptr parent; std::string key; bool operator==(const Field& rhs) const; bool operator!=(const Field& rhs) const; }; struct LValueHasher { size_t operator()(const LValue& lvalue) const; }; const LValue* baseof(const LValue& lvalue); std::optional tryGetLValue(const class AstExpr& expr); // Utility function: breaks down an LValue to get at the Symbol Symbol getBaseSymbol(const LValue& lvalue); template const T* get(const LValue& lvalue) { return get_if(&lvalue); } using RefinementMap = std::unordered_map; void merge(RefinementMap& l, const RefinementMap& r, std::function f); void addRefinement(RefinementMap& refis, const LValue& lvalue, TypeId ty); } // namespace Luau