Hmm, this is realy weird.
I tried an example from jassHelper manual:
But it still raise an error
What's wrong with stub methods, or how can I use them (because I realy need to overwrite parent methods). Thanks for any advices.
I tried an example from jassHelper manual:
JASS:
struct Parent
stub method xx takes nothing returns nothing
call BJDebugMsg("Parent")
endmethod
method doSomething takes nothing returns nothing
call this.xx()
call this.xx()
endmethod
endstruct
struct ChildA extends Parent
method xx takes nothing returns nothing
call BJDebugMsg("- Child A -")
endmethod
endstruct
struct ChildB extends Parent
method xx takes nothing returns nothing
call BJDebugMsg("- Child B --")
endmethod
endstruct
function test takes nothing returns nothing
local Parent P = Parent.create()
local Parent A = ChildA.create()
local Parent B = ChildB.create()
//notice the variables are of the 'Parent' type.
call P.doSomething() //Shows 'Parent' twice
call A.doSomething() //Shows 'Child A' twice
call B.doSomething() //Shows 'Child B' twice
endfunction
But it still raise an error
Code:
Unexpected: " xx takes nothing returns nothing"