I need to point out an outdated array type declaration (well, actually, more than one) to help port our code to the more advanced and flexible TArray<T> .
I tried this:
type TArrayChars = array of Char deprecated;
but I got a compilation error: E2029 ';' expected but identifier 'deprecated' found E2029 ';' expected but identifier 'deprecated' found
The same thing works if the declared type is not an array, for example:
type TFieldChars = set of Char deprecated;
Please note that this should be feasible by design.
What am I missing?
This seems to be a bug in Delphi (at least 10.1 Berlin and 10.2 Tokyo).
My accepted answer offers a neat workaround , i.e.:
type TArrayCharsOld = array of Char; TArrayChars = TArrayCharsOld deprecated;
I will write a bug report in Embarcadero.
This is the QC Embarcadero question I submitted: https://quality.embarcadero.com/browse/RSP-18316
arrays deprecated delphi
Bozzy
source share