Linux Island ord() bug

I’ve found a bug with the ord() function in Linux Island Oxygene programs. Does not seem to be present with .Net Core programs.

namespace ConsoleApplication1;

type
    Program = class
    public

        class method Main(args: array of String): Int32;
        begin
          writeLn(ord(false));
          writeLn(ord(true));
          writeLn(ord(not true));
          writeLn(ord(not false));
          var x : Boolean := false;
          writeLn(ord(x).ToString());
          writeLn(ord(not x).ToString());
        end;

    end;

end.

The last writeLn() displays -1, instead of the expected 1.

Project: testcase.zip (2.4 KB)

Not sure oof this is considered a bug, 0 is false, and really any non-zero value is considered true. but I’ll check with the compiler team.

Thanks, logged as bugs://83398

hi,

can you tell me which version you are using? Fridays build seems to properly emit 0/1 in all cases.

bugs://83398 got closed with status cannotrepro.

I was using 2437, the last stable build. This morning I downloaded 2445, which does seem to work properly. Thanks.

2 Likes