Skip to content

Typechecking on Functions #1260

Answered by alexmccord
Uhsleep asked this question in Q&A
May 19, 2024 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Okay. I asked because luau-analyze was separate from luau and it wasn't mentioned in there.

So, it is the case that a function of the type () -> () is compatible with (number, string) -> nil, ignoring the () vs nil that we've grown to regret. You are always allowed to pass excess amount of arguments to a function because that function doesn't make use of those excess arguments. Therefore no errors are produced.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Uhsleep
Comment options

@alexmccord
Comment options

Answer selected by Uhsleep
@Uhsleep
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants