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

typeof with invalid setmetatable arguments and a table intersection crashes new solver's strict mode #1405

Closed
nothing1649 opened this issue Sep 13, 2024 · 3 comments
Assignees
Labels
bug Something isn't working new solver This issue is specific to the new solver.

Comments

@nothing1649
Copy link

As of version 0.642, the following code in the new solver's strict mode causes the linter to crash completely, becoming unresponsive and replacing all type errors with a "subtyping test returned invalid path" error.

--!strict
type self = {} & {}
type Class = typeof(setmetatable())
local function _(): Class
	return setmetatable({}::self, {}) --Subtyping test returned a reasoning with an invalid path
end
@nothing1649 nothing1649 added the bug Something isn't working label Sep 13, 2024
@aatxe aatxe added the new solver This issue is specific to the new solver. label Sep 13, 2024
@metatablecat
Copy link

metatablecat commented Sep 28, 2024

This crashes with the statement

type x = setmetatable({} :: {}... as well

Leaving this here because it's likely the same underlying bug.

@vegorov-rbx vegorov-rbx self-assigned this Sep 30, 2024
@vegorov-rbx
Copy link
Collaborator

We have a fix for this issue prepared internally for the next sync.

andyfriesen added a commit that referenced this issue Oct 4, 2024
# General Updates

* Fix some cases where documentation symbols would not be available when
mouseovering at certain positions in the code
* Scaffolding to help embedders have more control over how `typeof(x)`
refines types
* Refinements to require-by-string semantics. See
luau-lang/rfcs#56 for details.
* Fix for #1405

# New Solver

* Fix many crashes (thanks you for your bug reports!)
* Type functions can now call each other
* Type functions all evaluate in a single VM. This should improve
typechecking performance and reduce memory use.
* `export type function` is now forbidden and fails with a clear error
message
* Type functions that access locals in the surrounding environment are
now properly a parse error
* You can now use `:setindexer(types.never, types.never)` to delete an
indexer from a table type.

# Internal Contributors

Co-authored-by: Aaron Weiss <[email protected]>
Co-authored-by: Hunter Goldstein <[email protected]>
Co-authored-by: Varun Saini <[email protected]>
Co-authored-by: Vyacheslav Egorov <[email protected]>
@vegorov-rbx
Copy link
Collaborator

This has been fixed in the sync before the last one #1458

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

4 participants