-
Notifications
You must be signed in to change notification settings - Fork 63
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
Refactor for new solver #783
Refactor for new solver #783
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! Looks mostly good to me
In addition, the nonstrict mode has been significantly improved, meaning #83 has been completely sidestepped
I don't think this is completely true. We are now going to trigger false positives again in the new type checker due to mismatched types. What we need to do is implement appropriate read/write
types to the generated DataModel types. i.e., the read
type should be the more expressive DM type, whilst the write
type should be the generic Roblox type, allowing you to correctly read inst.Parent
but write anything to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also can you add some tests to Autocomplete.test.cpp
for this?
You might be able to just re-use the existing tests, maybe switch them to use LUAU_BOTH_SOLVERS_TEST_CASE_FIXTURE
so that they test with both solvers
650c3a4
to
e788b68
Compare
I checked and it flat out does not work either way with both examples in #83, but in a different way. There's no warning at all, but the first argument of the connection is |
Did you end up adding the DataModel types for the new solver? I don't see a test case for it |
2b8163d
to
056a926
Compare
All tests passing woohoo!!!! |
0a1e882
to
5f3aa97
Compare
#806 is a blocker for new solver functionality until it's patched |
Do not merge - waiting on luau-lang/luau#1495 to remove the hacky mess workaround that is in here |
8cdf34a
to
3d85039
Compare
The tests will fail because you had me split off the InlayHints fix and I feel like flat out turning off the tests is a bad idea |
@checkraisefold Types smoketest is segfaulting, is this because of the flags? Ideally we don't crash even if the flags are not enabled |
It actually seems related to the recent luau update to 0.651. Going to undo that sync for now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Todo:
Luau issues worked around:
Blockers:
EDIT: Worked around with magic function
luau-lang/luau#1447 breaks the sourcemap WaitForChild overload registration and causes those tests to fail. I don't see a conceivable workaround for this for now because it causes a type checker error and there is no alternative to the magic function hereOriginal description:
The new solver has unified autocompletion and diagnostic types. In addition, the nonstrict mode has been significantly improved, meaning #83 has been completely sidestepped. As such, strict datamodel type flags should be ignored with the new solver enabled, and type registration should not occur on globalsForAutocomplete (because it is ignored by Luau).
In addition, loadDefinitionFile and by extension registerBuiltinGlobals, though still taking a typeCheckForAutocomplete argument, that argument no longer does anything within Luau internals, meaning the default to false is safe and it can be removed from explicit use.
Once the new solver is fully stable, the feature flag gates can be removed and this behavior can be the default.