Does Roblox or Luau remove unused code and/or functions?

I am wondering if Roblox or Luau removes unused code and/or functions?

Like, does this:

function unused()
    print("I am unused")
    used()
end

function used()
    print("I am used")
end

used()

Turn into this?

function used()
    print("I am used")
end

used()

Short answer: Kind of.

If you want to learn more about garbage collection this devforum post might be helpful;

1 Like