Nested generics cause unhandled compiler exception
Summary
In a small project, several classes are using nested generics:
- TmsObj is a base class of TObject, TmsList<T:TmsObj> should be a list to hold TmsObj items
- TmgObj is a base class of TmsObj, TmgList<T:TmgObj> is a list based on TmsList, to hold TmgObj items
- TmgGroup is inherited from TmgObj, and TmgGroups is inherited from TmgList
- TmgTariffs is inherited from TmgObj, and TmgTariffs is inherited from TmgList In the current form, the default compiliation succeded, but quick compilation will fail with an unhandled compiler exception. Please note: the actual implementations of TmsList etc. are not working, these are only stubs. But the project compiles (once) and I could reproduce the error several times.
System Information
- Operating system: Windows 10
- Processor architecture: x86-64
- Compiler version: 3.2.2, installed via fpcupdeluxe
- Device: Computer
Steps to reproduce
See example project, make a full compilation (Shift-F9), change something in UmgGroups, e.g. add or remove self.Description := 'foo';to LoadFromCache(), then do a quick compile (Ctrl-F9).
Example Project
What is the current bug behavior?
Debug: An unhandled exception occurred at $0000000100022F8D:
Debug: EListError: List index exceeds bounds (7)
Debug: $0000000100022F8D
Debug: $00000001000D45D1
Debug: $000000010019C469
Debug: $000000010019D46E
Debug: $000000010003DCE5
Debug: $00000001000D4805
Debug: $00000001000D3D1B
Debug: $00000001000D45D1
Debug: $00000001000D3F03
Debug: $00000001000D45D1
Debug: $000000010019C469
Debug: $000000010019D46E
Debug: $000000010003DCE5
Debug: $00000001000D4805
Debug: $00000001000D3D1B
Debug: $00000001000D45D1
Debug: $000000010019C469
Debug:
Verbose: X:\Lazarus\fpc\bin\x86_64-win64\ppcx64.exe returned an error exitcode
What is the expected (correct) behavior?
Should compile without errors