Przeglądaj źródła

better default value for result, removed mistaken understanding of CreateInstance

RyanTMontoya 1 rok temu
rodzic
commit
6adee9c8ea
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      Quick.RTTI.Utils.pas

+ 1 - 1
Quick.RTTI.Utils.pas

@@ -88,7 +88,7 @@ var
   rmethod: TRttiMethod;
   rinstype: TRttiInstanceType;
 begin
-  Result := CreateInstance<T>([]);
+  Result := Default(T);
   rtype := fCtx.GetType(TypeInfo(T));
   for rmethod in rtype.GetMethods do
   begin