What is the '[unknown]' in 'custom' functions?

Feel like going on a question spree today.

Hey I have been playing around with ‘custom functions’ not sure if that’s what they are actually called, and when I was using return in them, it always said on the autocomplete, [unknown] Add(numX, numY).
Here is what I mean:

I’ve used C# before and have heard of void and all, but I wanted to know what this means, because this only happens when I return it.

My questions:

What does this mean?
Can I change it?

It may sound stupid but I have been confused and really wanted to know what it is.
Thanks!

I personally don’t know for sure, but I think it means something to do with what you are using it for and using it with.

Is there anyway to change it if possible while still using return?

I am not the best scripter around, so my answer above was just a guess and don’t have an answer to your question that I am replying to now. Sorry!

1 Like

i’m pretty sure [unknown] is the return type or what it thinks the function is returning, if you create a function like:

local function return5()
  return 5
end

you’ll get number return5


3 Likes

And if you indicate the return value?

local function returnUnknow(boolean: boolean) => boolean
    if boolean then
        return true
    else
        return false
    end
end

Just am trying to use the „new“ Luau type checking (ops, just realized that you now should replace the => with a : or ->, see here for more informations), do this can help?

1 Like

i don’t think intellisense can analyze any type checking stuff yet, but it is plausible that at some point as the script editor is being worked on, we might get some more intelligent intellisense and what not. So when there is full native support for Luau type checking in the editor, i’m guessing we will be able to see the specified return and parameter types.


Also happy cake day! :cake:

1 Like