Hi
I’ve just installed the latest version and found problems in Java project code when using RTL types.
I get 'W42 : Comparing a value type with a reference type will box the value type and evaluates to “False” ’ for all string variables compared to the quoted char. Here is sample code :
namespace consoleapplication2;
uses
remobjects.elements.rtl.*,
java.util;
type
Program = class
public
class method Main(args: array of String): Int32;
begin
// add your own code here
writeLn('The magic happens here.');
var str : String := '=' ;
if str = '=' then begin // <- W42
str := str + ' ' ;
end ;
end;
end;
end.
When I comment remobjects.elements.rtl usage then the code works as expected. The previous Elements version worked fine.
Why using remobjects.elements.rtl changes the String type?
I tried to use functions like String.Compare( str, ‘=’) but they crash the application. Looks like I cannot compare a string variable with a char using this compiler version.
Artur