- changed title to Error in TValueHelper.TryGetLazyValue
Error in TValueHelper.TryGetLazyValue
Issue #375
resolved
When trying to get the value of an instance of a class of a Lazy type I get the exception 'Interface not supported.'
The code snippet below throws this exception:
var
lazyType: Lazy<TStringStream>;
lazyTypeValue: TValue;
lazyValue: TValue;
begin
lazyType := Lazy<TStringStream>.Create(
function: TStringStream
begin
Result := TStringStream.Create;
end, True);
lazyType.Value.WriteString('Some text');
lazyTypeValue := TValue.From<Lazy<TStringStream>>(lazyType);
if IsLazyType(lazyTypeValue.TypeInfo) then
begin
lazyTypeValue.TryGetLazyValue(lazyValue); // <- Exception raised here
end;
end;
Comments (3)
-
reporter -
repo owner - changed status to resolved
fixed
#375→ <<cset 9187328a9434>>
-
repo owner fixed
#375→ <<cset 847ce7b0aaa1>>
- Log in to comment