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(LuauNormalizeBlockedTypes)
|
||||
LUAU_FASTFLAG(DebugLuauReadWriteProperties)
|
||||
LUAU_FASTFLAG(LuauIntersectedBinopOverloadFix)
|
||||
|
||||
namespace Luau
|
||||
{
|
||||
|
@ -263,15 +264,18 @@ std::optional<TypeId> getMetatable(TypeId type, NotNull<BuiltinTypes> builtinTyp
|
|||
{
|
||||
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);
|
||||
if (partMT != std::nullopt)
|
||||
return partMT;
|
||||
for (TypeId part : itv->parts)
|
||||
{
|
||||
auto partMT = getMetatable(part, builtinTypes);
|
||||
if (partMT != std::nullopt)
|
||||
return partMT;
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
if (const MetatableType* mtType = get<MetatableType>(type))
|
||||
|
|
Loading…
Add table
Reference in a new issue