This already is reported as [RSP-25603: "Exception.RaiseOuterException can cause wrong W1035 warning"](https://quality.embarcadero.com/browse/RSP-25603).

---

Given the following (demo) function `F`, I have changed an exception raising statement to now chain exceptions:

```
--- before
+++ after
@@ -1,11 +1,11 @@
 function F(X: NativeInt): NativeInt;
 begin
   try
     Result := 1 div X;
   except
     on EDivByZero do
-      {ECustom}Exception.Create('...');
+      Exception.RaiseOuterException({ECustom}Exception.Create('...'));
     else
       raise;
   end;
 end;

```

Now, `Ctrl-F9` gives the warning [W1035](http://docwiki.embarcadero.com/RADStudio/Rio/en/W1035_Return_value_of_function_%27%25s%27_might_be_undefined_(Delphi)):

> 
> [dcc32 Warning]: W1035 Return value of function 'F' might be undefined
> 
> 
> 

However, all cases are handled. The compiler fails to recognize `Exception.RaiseOuterException` as the `raise` operation it is.

Unfortunately `FAcquireInnerException: Boolean` is private to the `Exception` class, not even to be set to `True` in derived custom classes which I could keep raising directly (`raise ECustomException.Create`).

Is there any way to make the compiler understand, while keeping the exceptions chained? Otherwise I can think of [`{$Warn No_RetVal Off}`](http://docwiki.embarcadero.com/RADStudio/Rio/en/Warning_messages_(Delphi)). How else could I work around this warning?