-
Notifications
You must be signed in to change notification settings - Fork 39
Lute check uses the new solver by default #711
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
Merged
Vighnesh-V
merged 9 commits into
luau-lang:primary
from
raymondnumbergenerator:check_new_solver
Jan 9, 2026
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9b7eadc
lute check use new solver by default
raymondnumbergenerator 0e603a7
stylua
raymondnumbergenerator 344372d
remove readasync from fs api in typecheck
raymondnumbergenerator 97ec4b0
removing kLuteDefinitions
raymondnumbergenerator a5b4e81
add cpp tests
raymondnumbergenerator 04990b6
stylua again
raymondnumbergenerator c06ef90
stylua
raymondnumbergenerator e052325
use newsolver.luau in staticrequires
raymondnumbergenerator cd54438
accidentally deleted newsolver.luau
raymondnumbergenerator File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| local fs = require("@std/fs") | ||
| local path = require("@std/path") | ||
| local process = require("@std/process") | ||
| local system = require("@std/system") | ||
| local test = require("@std/test") | ||
|
|
||
| local lutePath = path.format(process.execpath()) | ||
| local tmpDir = system.tmpdir() | ||
|
|
||
| test.suite("LuteTypeCheck", function(suite) | ||
| suite:case("UsesNewSolver", function(assert) | ||
| local testFilePath = path.format(path.join(tmpDir, "check_new_solver.luau")) | ||
| -- This file should fail the old solver | ||
| fs.writestringtofile( | ||
| testFilePath, | ||
| [[ | ||
| function add(a, b) | ||
| return a + b | ||
| end | ||
| local vec2 = {} | ||
| function vec2.new(x, y) | ||
| return setmetatable({ x = x or 0, y = y or 0 }, { | ||
| __add = function(v1, v2) | ||
| return { x = v1.x + v2.x, y = v1.y + v2.y } | ||
| end, | ||
| }) | ||
| end | ||
| add(1, 1) | ||
| add(vec2.new(0, 0), vec2.new(1, 1)) | ||
|
|
||
| add(vec2.new(0, 0), vec2.new(1,1)) | ||
raymondnumbergenerator marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ]] | ||
| ) | ||
|
|
||
| local result = process.run({ lutePath, "check", testFilePath }) | ||
| assert.eq(result.exitcode, 0) | ||
| fs.remove(testFilePath) | ||
| end) | ||
| end) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| -- This file should fail the old solver | ||
| function add(a, b) | ||
| return a + b | ||
| end | ||
| local vec2 = {} | ||
| function vec2.new(x, y) | ||
| return setmetatable({ x = x or 0, y = y or 0 }, { | ||
| __add = function(v1, v2) | ||
| return { x = v1.x + v2.x, y = v1.y + v2.y } | ||
| end, | ||
| }) | ||
| end | ||
| add(1, 1) | ||
| add(vec2.new(0, 0), vec2.new(1, 1)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| #include "lute/tc.h" | ||
|
|
||
| #include "Luau/FileUtils.h" | ||
|
|
||
| #include "doctest.h" | ||
| #include "lutefixture.h" | ||
| #include "luteprojectroot.h" | ||
|
|
||
| TEST_CASE_FIXTURE(LuteFixture, "typecheck_uses_new_solver") | ||
| { | ||
| std::string luteProjectRoot = getLuteProjectRootAbsolute(); | ||
| std::string testFilePath = joinPaths(luteProjectRoot, "tests/src/staticrequires/newsolver.luau"); | ||
|
|
||
| auto result = typecheck({testFilePath}, getReporter()); | ||
| CHECK(result == 0); | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.