mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Use new fflag in getMetatable helper
This commit is contained in:
parent
3e727e3b1e
commit
639b16543e
1 changed files with 10 additions and 6 deletions
|
@ -27,6 +27,7 @@ LUAU_FASTINT(LuauTypeInferRecursionLimit)
|
||||||
LUAU_FASTFLAG(LuauInstantiateInSubtyping)
|
LUAU_FASTFLAG(LuauInstantiateInSubtyping)
|
||||||
LUAU_FASTFLAG(LuauNormalizeBlockedTypes)
|
LUAU_FASTFLAG(LuauNormalizeBlockedTypes)
|
||||||
LUAU_FASTFLAG(DebugLuauReadWriteProperties)
|
LUAU_FASTFLAG(DebugLuauReadWriteProperties)
|
||||||
|
LUAU_FASTFLAG(LuauIntersectedBinopOverloadFix)
|
||||||
|
|
||||||
namespace Luau
|
namespace Luau
|
||||||
{
|
{
|
||||||
|
@ -263,15 +264,18 @@ std::optional<TypeId> getMetatable(TypeId type, NotNull<BuiltinTypes> builtinTyp
|
||||||
{
|
{
|
||||||
type = follow(type);
|
type = follow(type);
|
||||||
|
|
||||||
if (const IntersectionType* itv = get<IntersectionType>(type))
|
if (FFlag::LuauIntersectedBinopOverloadFix)
|
||||||
{
|
{
|
||||||
for (TypeId part : itv->parts)
|
if (const IntersectionType* itv = get<IntersectionType>(type))
|
||||||
{
|
{
|
||||||
auto partMT = getMetatable(part, builtinTypes);
|
for (TypeId part : itv->parts)
|
||||||
if (partMT != std::nullopt)
|
{
|
||||||
return partMT;
|
auto partMT = getMetatable(part, builtinTypes);
|
||||||
|
if (partMT != std::nullopt)
|
||||||
|
return partMT;
|
||||||
|
}
|
||||||
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
return std::nullopt;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (const MetatableType* mtType = get<MetatableType>(type))
|
if (const MetatableType* mtType = get<MetatableType>(type))
|
||||||
|
|
Loading…
Add table
Reference in a new issue