Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions Analysis/src/BuiltinTypeFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ LUAU_FASTFLAGVARIABLE(LuauDontBlockRefinementUnconditionally)
LUAU_FASTFLAGVARIABLE(LuauSetmetatableOverrides)
LUAU_FLAGVERSION(LuauSetmetatableOverrides, 2)
LUAU_FASTFLAG(LuauTraverseScopeToFunction)
LUAU_FASTFLAGVARIABLE(LuauIndexImplAnyIndexerResultsInAny)

namespace Luau
{
Expand Down Expand Up @@ -2158,10 +2157,6 @@ TypeFunctionReductionResult<TypeId> indexFunctionImpl(
if (!indexerNormTy)
return {std::nullopt, Reduction::MaybeOk, {}, {}};

// if the indexer is `any`, then indexing also gives us `any`
if (FFlag::LuauIndexImplAnyIndexerResultsInAny && indexerNormTy->shouldSuppressErrors())
return {ctx->builtins->anyType, Reduction::MaybeOk, {}, {}};

// we're trying to reject any type that is not a string singleton or primitive (string, number, boolean, thread, nil, function, table, or buffer)
if (indexerNormTy->hasTops() || indexerNormTy->hasErrors())
return {std::nullopt, Reduction::Erroneous, {}, {}};
Expand Down
14 changes: 0 additions & 14 deletions tests/TypeFunction.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ LUAU_DYNAMIC_FASTINT(LuauTypeFamilyApplicationCartesianProductLimit)
LUAU_FASTFLAG(DebugLuauAssertOnForcedConstraint)
LUAU_FASTFLAG(LuauCloneTypeFunctionFromForeignArena)
LUAU_FASTFLAG(LuauNormalizeGuardAgainstNonTestableNegations)
LUAU_FASTFLAG(LuauIndexImplAnyIndexerResultsInAny)

struct TypeFunctionFixture : Fixture
{
Expand Down Expand Up @@ -2191,17 +2190,4 @@ TEST_CASE_FIXTURE(BuiltinsFixture, "oss_2634_negation_of_nontestable_type_doesnt
REQUIRE(get<NormalizationTooComplex>(result.errors[1]));
}

TEST_CASE_FIXTURE(BuiltinsFixture, "index_value_with_any_results_in_any")
{
DOES_NOT_PASS_OLD_SOLVER_GUARD();
ScopedFastFlag indexWithAnyResultsInAny{FFlag::LuauIndexImplAnyIndexerResultsInAny, true};

CheckResult result = check(R"(
local x: index<{ hello: string }, any>
)");

LUAU_REQUIRE_NO_ERRORS(result);
CHECK_EQ("any", toString(requireType("x")));
}

TEST_SUITE_END();
Loading