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

Type functions can be named "typeof" #1565

Open
nothing1649 opened this issue Dec 14, 2024 · 1 comment
Open

Type functions can be named "typeof" #1565

nothing1649 opened this issue Dec 14, 2024 · 1 comment
Labels
bug Something isn't working new solver This issue is specific to the new solver.

Comments

@nothing1649
Copy link

nothing1649 commented Dec 14, 2024

As of version 0.655, type functions can be named "typeof", which appears to be an oversight as type aliases can't be named typeof and cause a syntax error when attempting to do so. The resulting type function can't be used in a type alias (unless imported from a module).

--!strict
type function typeof(t) --no error
	return t
end

local _:typeof<number> = 1 --invalid, parsed as typeof type
@nothing1649 nothing1649 added the bug Something isn't working label Dec 14, 2024
@nothing1649
Copy link
Author

some of the text in the original post resulted from confusion with typeof(t) not returning 'type' as described in the type function rfc and causing me to think that it couldn't be called from another type function, i'll leave it up in case it isn't actually intended

@aatxe aatxe added the new solver This issue is specific to the new solver. label Dec 19, 2024
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