Skip to content

Commit 6adee9c

Browse files
committed
better default value for result, removed mistaken understanding of CreateInstance
1 parent 47bacaf commit 6adee9c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Quick.RTTI.Utils.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class function TRTTI.CreateInstance<T>(const Args: array of TValue): T;
8888
rmethod: TRttiMethod;
8989
rinstype: TRttiInstanceType;
9090
begin
91-
Result := CreateInstance<T>([]);
91+
Result := Default(T);
9292
rtype := fCtx.GetType(TypeInfo(T));
9393
for rmethod in rtype.GetMethods do
9494
begin

0 commit comments

Comments
 (0)