mirror of
https://github.com/luau-lang/luau.git
synced 2025-01-19 17:28:06 +00:00
d19a5f0699
## What's Changed? * Optimized the vector dot product by up to 24% * Allow for x/y/z/X/Y/Z vector field access by registering a `vector` metatable with an `__index` method (Fixes #1521) * Fixed a bug preventing consistent recovery from parse errors in table types. * Optimized `k*n` and `k+n` when types are known * Allow fragment autocomplete to handle cases like the automatic insertion of parens, keywords, strings, etc., while maintaining a correct relative positioning ### New Solver * Allow for `nil` assignment to tables and classes with indexers --------- Co-authored-by: Aaron Weiss <aaronweiss@roblox.com> Co-authored-by: Andy Friesen <afriesen@roblox.com> Co-authored-by: Aviral Goel <agoel@roblox.com> Co-authored-by: Hunter Goldstein <hgoldstein@roblox.com> Co-authored-by: Varun Saini <vsaini@roblox.com> Co-authored-by: Vighnesh Vijay <vvijay@roblox.com> Co-authored-by: Vyacheslav Egorov <vegorov@roblox.com>
31 lines
548 B
C++
31 lines
548 B
C++
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
|
|
#include "Luau/Unifiable.h"
|
|
#include "Luau/TypeFwd.h"
|
|
#include "Luau/TypePack.h"
|
|
|
|
namespace Luau
|
|
{
|
|
namespace Unifiable
|
|
{
|
|
|
|
static int nextIndex = 0;
|
|
|
|
int freshIndex()
|
|
{
|
|
return ++nextIndex;
|
|
}
|
|
|
|
template<typename Id>
|
|
Error<Id>::Error()
|
|
: index(++nextIndex)
|
|
{
|
|
}
|
|
|
|
template<typename Id>
|
|
int Error<Id>::nextIndex = 0;
|
|
|
|
template struct Error<TypeId>;
|
|
template struct Error<TypePackId>;
|
|
|
|
} // namespace Unifiable
|
|
} // namespace Luau
|