// this script was compiled with wurst 1.8.1.0-jenkins-Wurst-1365 globals integer array Func_nextFree integer Func_firstFree=0 integer Func_maxIndex=0 integer array Func_typeId endglobals native testSuccess takes nothing returns nothing function initGlobals takes nothing returns nothing set Func_firstFree = 0 set Func_maxIndex = 0 endfunction function error takes string msg returns nothing call BJDebugMsg(msg + "\n" + "") endfunction function alloc_Func_bar_A takes nothing returns integer local integer this if Func_firstFree == 0 then if Func_maxIndex < 32768 then set Func_maxIndex = Func_maxIndex + 1 set this = Func_maxIndex set Func_typeId[this] = 2 else call error("Out of memory: Could not create Func_bar_A.") set this = 0 endif else set Func_firstFree = Func_firstFree - 1 set this = Func_nextFree[Func_firstFree] set Func_typeId[this] = 2 endif return this endfunction function apply_bar_A takes integer this, integer x returns integer return x + 1 endfunction function dispatch_Func_A_Func_apply takes integer this, integer x returns integer local integer A_Func_apply_result if Func_typeId[this] == 0 then if this == 0 then call error("Nullpointer exception when calling Func.apply") else call error("Called Func.apply on invalid object.") endif endif set A_Func_apply_result = apply_bar_A(this, x) return A_Func_apply_result endfunction function bar takes integer f returns integer return dispatch_Func_A_Func_apply(f, 1) endfunction function init_A takes nothing returns nothing local integer clVar = alloc_Func_bar_A() if bar(clVar) == 2 then call testSuccess() endif endfunction function main takes nothing returns nothing call initGlobals() call init_A() endfunction function config takes nothing returns nothing endfunction