mirror of
https://github.com/luau-lang/luau.git
synced 2025-01-19 17:28:06 +00:00
Merge branch 'master' into merge
This commit is contained in:
commit
d66e088af8
3 changed files with 38 additions and 4 deletions
10
.github/workflows/release.yml
vendored
10
.github/workflows/release.yml
vendored
|
@ -23,17 +23,18 @@ jobs:
|
|||
run: cmake . -DCMAKE_BUILD_TYPE=Release
|
||||
- name: build
|
||||
run: cmake --build . --target Luau.Repl.CLI Luau.Analyze.CLI Luau.Compile.CLI --config Release -j 2
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: matrix.os.name != 'windows'
|
||||
with:
|
||||
name: luau-${{matrix.os.name}}
|
||||
path: luau*
|
||||
- uses: actions/upload-artifact@v2
|
||||
overwrite: true
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: matrix.os.name == 'windows'
|
||||
with:
|
||||
name: luau-${{matrix.os.name}}
|
||||
path: Release\luau*.exe
|
||||
|
||||
overwrite: true
|
||||
web:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
@ -52,7 +53,8 @@ jobs:
|
|||
source emsdk/emsdk_env.sh
|
||||
emcmake cmake . -DLUAU_BUILD_WEB=ON -DCMAKE_BUILD_TYPE=Release
|
||||
make -j2 Luau.Web
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Luau.Web.js
|
||||
path: Luau.Web.js
|
||||
overwrite: true
|
||||
|
|
|
@ -2206,6 +2206,12 @@ TypeFunctionReductionResult<TypeId> indexFunctionImpl(
|
|||
return {std::nullopt, true, {}, {}};
|
||||
|
||||
TypeId indexerTy = follow(typeParams.at(1));
|
||||
|
||||
if (isPending(indexerTy, ctx->solver))
|
||||
{
|
||||
return {std::nullopt, false, {indexerTy}, {}};
|
||||
}
|
||||
|
||||
std::shared_ptr<const NormalizedType> indexerNormTy = ctx->normalizer->normalize(indexerTy);
|
||||
|
||||
// if the indexer failed to normalize, we can't reduce, but know nothing about inhabitance.
|
||||
|
|
|
@ -927,6 +927,32 @@ TEST_CASE_FIXTURE(BuiltinsFixture, "index_type_function_works")
|
|||
CHECK_EQ("string", toString(tpm->givenTp));
|
||||
}
|
||||
|
||||
TEST_CASE_FIXTURE(BuiltinsFixture, "index_wait_for_pending_no_crash")
|
||||
{
|
||||
if (!FFlag::LuauSolverV2)
|
||||
return;
|
||||
|
||||
CheckResult result = check(R"(
|
||||
local PlayerData = {
|
||||
Coins = 0,
|
||||
Level = 1,
|
||||
Exp = 0,
|
||||
MaxExp = 100
|
||||
}
|
||||
|
||||
type Keys = index<typeof(PlayerData), keyof<typeof(PlayerData)>>
|
||||
|
||||
-- This function makes it think that there's going to be a pending expansion
|
||||
local function UpdateData(key: Keys, value)
|
||||
PlayerData[key] = value
|
||||
end
|
||||
|
||||
UpdateData("Coins", 2)
|
||||
)");
|
||||
|
||||
// Should not crash!
|
||||
}
|
||||
|
||||
TEST_CASE_FIXTURE(BuiltinsFixture, "index_type_function_works_w_array")
|
||||
{
|
||||
if (!FFlag::LuauSolverV2)
|
||||
|
|
Loading…
Reference in a new issue