wurstscript / WurstScript

Programming language and toolkit to create Warcraft III Maps
https://wurstlang.org
Apache License 2.0
226 stars 28 forks source link

"You encountered a bug in the interpreter: java.lang.NullPointerException" On a unit test #1006

Closed GetLocalPlayer closed 3 years ago

GetLocalPlayer commented 3 years ago

During a unit test

Running <GroupTests:4 - testGroupBasic>..
    You encountered a bug in the interpreter: java.lang.NullPointerException
  at P:\WC3\WurstStdlib2\wurst\_handles\Group.wurst line 49
... when calling group_add(group612, varargs[unit606]) in GroupTests.wurst:11
... when calling testGroupBasic() in GroupTests.wurst:4

Was changing Group.wurst package

public function group.add(vararg unit units) returns integer
    var i = 0
    for u in units
        if GroupAddUnit(this, u)     // <-- This is line 49
            i += 1
    return i
Frotty commented 3 years ago

The compiletime implementation for GroupAddUnit has no return type, this is the issue here.