ItsDeltin / Overwatch-Script-To-Workshop

Converts scripts to Overwatch workshops.
209 stars 26 forks source link

Calling 'this' returns wrong values when used in expression trees. #135

Closed ItsDeltin closed 4 years ago

ItsDeltin commented 4 years ago
class MyClass
{
    AnotherClass anotherClass;

    public void Test()
    {
        // The 'this' here will return 'anotherClass' rather than the current MyClass instance.
        anotherClass.DoSomething(this);
    }
}
ItsDeltin commented 4 years ago

Workaround is to store this:

define realThis! = this;
anotherClass.DoSomething(realThis);
ItsDeltin commented 4 years ago

Fixed in v1.3.