mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Add FFlag
This commit is contained in:
parent
1e4a993f20
commit
8a93a16738
2 changed files with 4 additions and 1 deletions
|
@ -49,6 +49,7 @@ LUAU_FASTFLAGVARIABLE(LuauReportShadowedTypeAlias, false)
|
||||||
LUAU_FASTFLAGVARIABLE(LuauBetterMessagingOnCountMismatch, false)
|
LUAU_FASTFLAGVARIABLE(LuauBetterMessagingOnCountMismatch, false)
|
||||||
LUAU_FASTFLAGVARIABLE(LuauArgMismatchReportFunctionLocation, false)
|
LUAU_FASTFLAGVARIABLE(LuauArgMismatchReportFunctionLocation, false)
|
||||||
LUAU_FASTFLAGVARIABLE(LuauImplicitElseRefinement, false)
|
LUAU_FASTFLAGVARIABLE(LuauImplicitElseRefinement, false)
|
||||||
|
LUAU_FASTFLAGVARIABLE(LuauCallableClasses, false)
|
||||||
|
|
||||||
namespace Luau
|
namespace Luau
|
||||||
{
|
{
|
||||||
|
@ -4140,7 +4141,7 @@ std::optional<WithPredicate<TypePackId>> TypeChecker::checkCallOverload(const Sc
|
||||||
if (const MetatableTypeVar* mttv = get<MetatableTypeVar>(fn))
|
if (const MetatableTypeVar* mttv = get<MetatableTypeVar>(fn))
|
||||||
{
|
{
|
||||||
callTy = getIndexTypeFromType(scope, mttv->metatable, "__call", expr.func->location, /* addErrors= */ false);
|
callTy = getIndexTypeFromType(scope, mttv->metatable, "__call", expr.func->location, /* addErrors= */ false);
|
||||||
} else if (const ClassTypeVar* ctv = get<ClassTypeVar>(fn); ctv && ctv->metatable)
|
} else if (const ClassTypeVar* ctv = get<ClassTypeVar>(fn); FFlag::LuauCallableClasses && ctv && ctv->metatable)
|
||||||
{
|
{
|
||||||
callTy = getIndexTypeFromType(scope, *ctv->metatable, "__call", expr.func->location, /* addErrors= */ false);
|
callTy = getIndexTypeFromType(scope, *ctv->metatable, "__call", expr.func->location, /* addErrors= */ false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -523,6 +523,8 @@ TEST_CASE_FIXTURE(ClassFixture, "unions_of_intersections_of_classes")
|
||||||
|
|
||||||
TEST_CASE_FIXTURE(ClassFixture, "callable_classes")
|
TEST_CASE_FIXTURE(ClassFixture, "callable_classes")
|
||||||
{
|
{
|
||||||
|
ScopedFastFlag luauCallableClasses{"LuauCallableClasses", true};
|
||||||
|
|
||||||
CheckResult result = check(R"(
|
CheckResult result = check(R"(
|
||||||
local x : CallableClass
|
local x : CallableClass
|
||||||
local y = x("testing")
|
local y = x("testing")
|
||||||
|
|
Loading…
Add table
Reference in a new issue