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

New type solver throws unclear type error when returning table with an optional Roblox data type #1402

Open
Daw588 opened this issue Sep 13, 2024 · 1 comment
Labels
bug Something isn't working new solver This issue is specific to the new solver.

Comments

@Daw588
Copy link

Daw588 commented Sep 13, 2024

This issue only seems to occur for Vector3, Vector2, CFrame, and other Roblox data types, but not for Luau primitive data types.

local function FuncA(): { Value: Vector3? }
	return {
		Value = Vector3.zero -- TypeError: Type pack '{ Value: Vector3 }' could not be converted into '{ Value: Vector3? }'; type { Value: Vector3 }[0][read "Value"] (Vector3) is not exactly { Value: Vector3? }[0][read "Value"][1] (nil) Luau(1035)
	}
end

FuncA()

local function FuncB(): { Value: number? }
	return {
		Value = 1 -- OK
	}
end

FuncB()
@Daw588 Daw588 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
@aatxe
Copy link
Collaborator

aatxe commented Sep 13, 2024

This probably has absolutely nothing to do with Roblox data types. My immediate best guess is that this is a problem with some of the expected type code, but we'll investigate it when we can.

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