Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assert triggered in new type solver for Intersection Types #1391

Open
karl-police opened this issue Sep 11, 2024 · 0 comments
Open

assert triggered in new type solver for Intersection Types #1391

karl-police opened this issue Sep 11, 2024 · 0 comments
Labels
bug Something isn't working new solver This issue is specific to the new solver.

Comments

@karl-police
Copy link
Contributor

karl-police commented Sep 11, 2024

TEST_CASE_FIXTURE(ACBuiltinsFixture, "test1")
{
    TypeArena arena;
    frontend.globals.globalScope->exportedTypeBindings["FreeTable"] = TypeFun{{}, arena.addType(TableType{TableState::Free, TypeLevel{}})};

    if (!FFlag::LuauSolverV2)
        return;

    CheckResult check1 = check(R"(
local test = {}
test.entry = 2

local tbl_A = {} :: typeof(test) & FreeTable
tbl_A.abc = 1

print(tbl_A.notWritingTo)

function test(a)
    a.@3
    if (a.propertyTest) then return true end
    return false
end

test({@2})

tbl_A.@1
)");

    auto test1 = toString(requireType("tbl_A"));
    auto test2 = requireType("tbl_A");

    auto ac1 = autocomplete('1');

    auto ac2 = autocomplete('2');
    auto ac3 = autocomplete('3');
}

It triggers at where the red arrow is pointing at.

image

The red framed line of code is the thing that I put there that would "silence" the error, whether I don't know whether it's actually the right fix. To test that I removed the intersection and the entryMap size was the same, so maybe id = follow(id) is the fix.

@karl-police karl-police added the bug Something isn't working label Sep 11, 2024
@karl-police karl-police changed the title assert triggered in new type solver specifically for Intersection Types assert triggered in new type solver for Intersection Types Sep 11, 2024
@aatxe aatxe added the new solver This issue is specific to the new solver. label Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new solver This issue is specific to the new solver.
Development

No branches or pull requests

2 participants