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

and or expression causes type pack error with new type solver's strict mode #1271

Closed
Ketasaja opened this issue May 27, 2024 · 1 comment
Closed
Labels
bug Something isn't working new solver This issue is specific to the new solver.

Comments

@Ketasaja
Copy link
Contributor

Ketasaja commented May 27, 2024

Tested on 0.627 with no errors in non-strict mode.

--!strict
local function _(): string
	if true then
		return table.concat({} :: {[any]: any}, true and "" or "") -- TypeError: Type pack '*blocked-tp-285*' could not be converted into 'string'; type *blocked-tp-285*.tail() (*blocked-tp-285*) is not a subtype of string (string)
	else
		return table.concat({} :: {[any]: any}, if true then "" else "")
	end
end

local function __(): {string}
	if true then
		return string.split("", true and "" or "") -- TypeError: Type pack '*blocked-tp-958*' could not be converted into '{string}'; type *blocked-tp-958*.tail() (*blocked-tp-958*) is not a subtype of {string} ({string})
	else
		return string.split("", if true then "" else "")
	end
end
@Ketasaja Ketasaja added the bug Something isn't working label May 27, 2024
@alexmccord alexmccord added the new solver This issue is specific to the new solver. label May 28, 2024
@Ketasaja
Copy link
Contributor Author

Fixed as of 0.635.

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