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

PrimitiveTypeConstraint issue, where it blocks its own constraint ConstraintSolvingIncompleteError #1395

Open
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")
{
    ScopedFastFlag sff[]{
        {FFlag::LuauSolverV2, true},
        //{FFlag::DebugLuauLogSolver, true},
        //{FFlag::DebugLuauLogBindings, true},
        //{FFlag::DebugLuauLogSolverToJson, true}
    };

    CheckResult check1 = check(R"(
local v1: string?

local stringButItIsHere = "Windows"

v1 = if true then stringButItIsHere
elseif false then "Something"
else "Other"
)");

    //LUAU_REQUIRE_NO_ERRORS(check1);

    auto test1 = requireType("v1");
    //auto test2 = toString(check1.errors[1]);
}

https://discord.com/channels/385151591524597761/1283231116387680388

This triggers Type '"Windows"' could not be converted into '("Windows" <: 'a <: string)'

image

and many more
image

v1 = if true then stringButItIsHere
elseif false then "Something"
else "Other"

The issue is that this assignment is not resolving into string, hence why that typemismatch error happens.

This is the Solver JSON for it: https://paste.ivr.fi/amidomibop.json

 

Other

I tried this change.

image

This worked until it triggered an error on a different Unit Test.

https://luau-lang.github.io/dcr-timetraveler/

Which was the Unit Test string_singleton_in_if_statement2

JSON Files for DCR Time Traveler:

@karl-police karl-police added the bug Something isn't working label Sep 11, 2024
@karl-police karl-police changed the title PrimitiveTypeConstraint issue, where it blocks its own constraint PrimitiveTypeConstraint issue, where it blocks its own constraint ConstraintSolvingIncompleteError Sep 12, 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