String.ToInteger helper broken

Issue #218 resolved
Josef Kučera created an issue

Hello,
today I have noticed that ever since commit 3be6a492019fba79e0f898b654f16208b377fe2e the ToInteger helper resolution fails. I believe the ‘ToInteger’ registration for TTryStrToIntBaseFunc should not be there. Tiny sample script attached.

Best regards,
Joe

Comments (5)

  1. Eric Grange repo owner

    Yes, you’re right, however I cannot reproduce it with your example, but I can with an extra line

    var LValue:= '123';
    var LInt:= LValue.ToInteger + 1;    // passes
    var Lint2 := LValue.ToInteger(8, -1);   // fails because mapped to TryStrToIntBase
    

    was that a line missing from your snippet, or is there another issue ?

  2. Josef Kučera reporter

    Uh oh, I make a mistake. I have not tried the attached script with the Test suite. I have prepared it separately inside my program (not all function units are used there). Unfortunately, the TdwsCompiler.ReadTypeHelper() method gets the other ToInteger symbol when calling FindSymbol, thus eventually failing with “More arguments expected”, as the TryStrToIntBase is not marked as overloaded. I was not successful in updating the script, to make it fail with the Test suite, sorry.

  3. Josef Kučera reporter

    Yes, the issue is now fixed. Only one ToInteger symbol remained to be found and thus all working fine. Many thanks.

  4. Log in to comment