Browser console reports "Unreachable code" for functions that only contain an Exit() statement
Original Reporter info from Mantis: PascalDragon @PascalDragon
-
Reporter name: Sven Barth
Original Reporter info from Mantis: PascalDragon @PascalDragon
- Reporter name: Sven Barth
Description:
When a function only contains an Exit() statement the browser's console (at least in Firefox) reports "Unreachable code" due to the translation of the Exit statement being followed by a "return Result".
Steps to reproduce:
Compile the attached example and open test.html inside a browser.
Additional information:
I noticed this when using Generics.Collections.TList<>. The TEnumerator<>.MoveNext contains such a construct which makes using it rather verbose inside the browser. So if this can't be solved right now it might be a good idea to fix TEnumerator<>.MoveNext as well as TEnumerable<>.GetEnumerator.
Mantis conversion info:
- Mantis ID: 37247
- Build: 776
- Version: trunk