Our projects (.NET and Java) again fail to compile after changes in the recent stable release.
In 13.0.0.3095, everything worked; in the next stable release, we had issues with Dimension and Java with Seconds, but .NET worked. The new release fails with ~700 duplicated errors. I’ve managed to prepare a test case project that covers all of them.
E: Unknown identifier "Create" [Test3139\Program.pas (21)] E: Ambiguous call to overloaded method "new" [Test3139\Program.pas (59)] E: No method "AssignedBusyEvent" with matching delegate signature "(_sender: Object; _e: EventArgs)" could be found in type "Program" [Test3139\Program.pas (62)] E: Cannot get address of value [Test3139\Program.pas (63)] E: No member "Equals" on type "T" [Test3139\Program.pas (72)](Java)
Now assigning events, delegates, or property callbacks using @ operator doesn’t work and is treated as a Delphi address. Please adjust the latest compiler changes to be compatible with older releases.
Hi Artur - my apologies. These will be regressions caused by work I’ve made, and will be code that runs when DelphiCompatibility is true, as in your settings.
Almost all errors are fixed. Two units left where I get the error:
(E486) Parameter 1 is "TGIS_VPFExecAddPartEvent", should be "Delegate", in call to Delegate.Remove(source: Delegate; value: Delegate): Delegate (E406) No overloaded method "Combine" with these parameters on type "Delegate", best matching overload is "Combine(a: Delegate; b: Delegate): Delegate"
Code of a class:
type
TGIS_VPFExecAddPartEvent = procedure of object ;
variable:
FOnAddPart : TGIS_VPFExecAddPartEvent ;
and event:
/// <event/>
/// <summary>
/// AddPart event. Will be fired when a new part is added to shape.
/// </summary>
event AddPartEvent : TGIS_VPFExecAddPartEvent
delegate FOnAddPart ;
There are more events and types here, but only those two with procedure of obj without params fails.
I have an additional question about the Java and introduced units feature. I still have errors in the code like :
function CompareDateTime(
_d1 : DateTime ;
_d2 : DateTime
) : Integer ;
var
res : TimeSpan ;
milis : Float ;
begin
res := _d1 - _d2 ;
milis := res.getTotalMilliSeconds ; <-(E129) Cannot cast from "Milliseconds" to "nullable Float"
if milis > 0 then
Result := 1
else if milis < 0 then
Result := -1
else
Result := 0 ;
end;
function Now : TDateTime ;
begin
{$IF CLR}
Result := TDateTime.Now ;
{$ENDIF}
{$IF JAVA}
Result := DateTime.UtcNow ;
Result := Result.AddSeconds(-Result.OffsetToUTC); <-(E406) No overloaded method "AddSeconds" with these parameters on type "TDateTime", best matching overload is "method AddSeconds(aValue: RemObjects.Oxygene.System.Integer): not nullable DateTime"
java.util.Calendar(Result).setTimeZone(java.util.TimeZone.Default);
{$ENDIF}
end ;
Can you suggest fixes that work with the new compiler?
iirc units auto-convert only between compatible units (e.g., milliseconds to Seconds), but to go to a generic float, it needs a hard as Single/as Double cast.
The idea being to prevent
var x: Double :=MyMillisecondsValue;
var y: Double :=MySecondsValue;
x+Y; // now w ehave mixed uits, w/o any warning
is that RTL2 DateTime? If so, use the scale-less Result.Add(-Result.OffsetToUTC); if the inut value is a Unit. Same problem here: converting a concrete unit to an unscaled integer loses info & could lead to mixing units.
I could be wrong, i’m just going by the standalone snippets w/o full context.
My bad, i might have sent you the wrong branch. Can you try RemObjects Elements - 13.0.0.3140 (C).exe? (this one doesn’t have Water but it’ll keep the existing 3140 Water you have on upgrade)
Thanks. .NET works now (basic tests). Java compiles but throws exceptions at runtime:
when creating a dictionary
An unhandled exception of type 'java.lang.ClassFormatError' occurred in tatukgis.jdk.jar. Additional information: Duplicate method name "equals" with signature "(Ljava.lang.Object;)Z" in class file ....
calling some Swing components
An unhandled exception of type 'java.lang.ClassCastException' occurred in tatukgis.jdk.jar. Additional information: tatukgis.jdk.pvl.TGIS_PvlActivationWizard cannot be cast to javax.swing.JComponent
In the meantime, I’m working on making a repro on this side. Could you please send the complete duplicate-method class name (including any $… suffix), both full stack traces, and the base-class declaration of TGIS_PvlActivationWizard? Those may give some hints.