Elements 2513: DelphiString = Char Operator

This is another example of code that works well under 2409, but does not compile under 2513. It is more curious than difficult to resolve, but it was easy to make the test case:

TestDelphiString.zip (2.8 KB)

Synopsis: Comparing a DelphiString to a char '*' fails to compile. The compiler fails to upgrade '*' to string, as promised in the documentation. Changing '*' to "*" helps, of course.

Are you sure this worked before, with DelphiString and char? this does not seem like a regression, DelphString simply does not currently offer an operator to compare with chars (but never did).

I’ll log an issue to have that added.

Thanks, logged as bugs://84482

Yes, definitely, it still works with my current 2409 setup.

Ok, then instead of just adding the operator, I’ll need to check with the compiler team; maybe that’s something that should happen automatically (upgrading chars to strings), and got regressed.

This works ok when you use “normal” Strings, not DelphiString, correct?

Yes. Normal Strings work correctly.

But, something strange is still going on with my

TestDelphiString.zip (2.8 KB)

test case, so you might want to take a closer look at it. In my setup, build sometimes produces the error message as shown in the zip, but occasionally my MS VS 2019 hangs and has to be restarted. This might be related with my issues from some other post earlier today, but may also indicate a compiler problem.

This now relates to Elements 2521.

This happens even with 2521?

Yes.

Sorry, my bad, I might have used 2513. I shall check again.

1 Like

Correction: This was happening with 2513 and seems not to happen with 2521.

Good, because thats exactly her kind of stuff the new system was supposed to fix :wink:

bugs://84482 got closed with status fixed.