Browse Source

* correctly raise exception

git-svn-id: trunk@36979 -
svenbarth 8 years ago
parent
commit
3cb8cb293d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/rtl-objpas/src/inc/rtti.pp

+ 1 - 1
packages/rtl-objpas/src/inc/rtti.pp

@@ -832,7 +832,7 @@ end;
 function TValue.AsInterface: IInterface;
 function TValue.AsInterface: IInterface;
 begin
 begin
   if Kind <> tkInterface then
   if Kind <> tkInterface then
-    EInvalidCast.Create(SErrInvalidTypecast);
+    raise EInvalidCast.Create(SErrInvalidTypecast);
   Result := PInterface(FData.FValueData.GetReferenceToRawData)^;
   Result := PInterface(FData.FValueData.GetReferenceToRawData)^;
 end;
 end;