Skip to content

Commit 224d15b

Browse files
committed
avoid calling non inlined getter in implicit operator
1 parent e19ebb4 commit 224d15b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Source/Base/Spring.pas

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8480,7 +8480,10 @@ function Weak<T>.TryGetTarget(out target: T): Boolean;
84808480

84818481
class operator Weak<T>.Implicit(const value: Weak<T>): T;
84828482
begin
8483-
Result := value.Target;
8483+
if Assigned(value.fReference) then
8484+
Result := PT(value.fTarget)^
8485+
else
8486+
Result := Default(T);
84848487
end;
84858488

84868489
class operator Weak<T>.Equal(const left: Weak<T>;

0 commit comments

Comments
 (0)