Skip to content

Free local variable definition

Franco Montenegro edited this page Apr 17, 2016 · 1 revision

Free local variable definition

Ever wanted to

function foo takes nothing returns nothing
    call bar()
    local unit baz = CreateUnit()
endfunction

Now you can. Do keep in mind that this

function foo takes nothing returns nothing
    call GetWidgetLife(baz)
    local unit baz = ...
endfunction

Is going to throw an error because baz is not yet defined.

Clone this wiki locally