I can't make it crash without -CR but indeed, when it is checked the code will not compile properly.
Since the method is legal (mapped to same space even with the hack), there seems to be a bug in verify method call that also affects code generation.
- The code without -CR does not crash and sees the correct overlay.
- The code with -CR draws a wrong conclusion and removes code, which causes the crash.
I think -CR contains a bug. Will investigate further on what code is actually generated.
TAuxStringGrid is a TStringGrid. No code is added, no fields are added, only a visibility specifier is promoted. That is legal for -CR.
BTW: It should not crash with the original code anyway: the method is within the visibility of the class, so the "hack"/overlay is not even necessary: again, that points to a bug in the compiler for -CR
[edit]
The Control style change does not affect the code path, so the method call is always correct. It seems -CR uses some kind of hashing that goes wrong.
Changing a field will change a hash, but then that hash is wrong since the method call is not affected. The code path suggests that if the control style is missing, the call does nothing.