// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details1#include "Luau/Symbol.h"23#include "Luau/Common.h"45LUAU_FASTFLAG(LuauSolverV2)67namespace Luau8{910bool Symbol::operator==(const Symbol& rhs) const11{12if (local)13return local == rhs.local;14else if (global.value)15return rhs.global.value && global == rhs.global.value; // Subtlety: AstName::operator==(const char*) uses strcmp, not pointer identity.16else17return !rhs.local && !rhs.global.value; // Reflexivity: we already know `this` Symbol is empty, so check that rhs is.18}1920std::string toString(const Symbol& name)21{22if (name.local)23return name.local->name.value;2425LUAU_ASSERT(name.global.value);26return name.global.value;27}2829} // namespace Luau303132