- changed status to resolved
Implicit operator overloading and record type input
Issue #131
resolved
Thank you for resolving #130. Now I have a similar problem with overloading the assignment operator, but this time the left side is Integer and the right side is a record.
I get the exception EVariantBadVarTypeError with the message "Invalid variant type".
P.S. I'm using dwcript with freepascal.
type
TFoo = record
X, Y: Integer;
end;
function OperImpFooInt(AFoo: TFoo): Integer;
begin
Result := AFoo.X + AFoo.Y;
end;
operator implicit (TFoo): Integer uses OperImpFooInt;
var F: TFoo;
var I: Integer;
begin
F.X := 10;
F.Y := 11;
I := F;
end.
Comments (2)
-
repo owner -
repo owner Exception was not triggered in Delphi by your snippet, but required a small variation.
Hopefully I fixed your bug, otherwise, well, I have fixed another bug :)
- Log in to comment
Fixed Issue
#131& added test case→ <<cset 6752384596c3>>