I may have found the reason for it, it seems the method call from a function within a method returns bogus results.
could someone else test this plese?
it should print 1 but it prints 2 in release mode and throws a memory exception in debug mode.
could someone else test this plese?
Type TThing Field Index:Int Function Create:TThing( index:Int) Local t:TThing = New TThing t.Index = index Return t EndFunction EndType Type TTest Field List:TList = New TList Method Find:TThing( index:Int) For Local t:TThing = EachIn List If t.Index = index Then Return t Next Return Null EndMethod Method Test() Function Search() Local t:TThing = Find( 1) If t Then Print t.Index Else Print "nope" EndIf EndFunction Search() EndMethod EndType Local test:TTest = New TTest test.List.AddLast( TThing.Create(0)) test.List.AddLast( TThing.Create(1)) test.List.AddLast( TThing.Create(2)) test.Test()
it should print 1 but it prints 2 in release mode and throws a memory exception in debug mode.