Waldek Hebisch wrote:
Frank Heckenbach wrote:
Prof A Olowofoyeku (The African Chief) wrote:
BTW, I don't think many real programs would run into this problem, because object type names and field names are usually quite different. Therefore I'd almost like to forbid it entirely, but for compatibility's sake, I'll go with a warning in BP mode.
A warning it is then!
OK, a warning in default and BP modes, and an error in ISO (i.e., OOE) mode. (fjf945*.pas)
AFAIKS in OOE mode `object' is not (or should not be) a keyword, so part of the problem vanishes. Do we implement `class' already?
Not yet, but I don't see how it relates to the issue. The issue, a potential confusion between two syntactically identical things, is the same in BP and OOE object models, AFAICS, so I think it would only add to the confusion to treat it differently based on the object model.
Of course, an OOE test program will need to use `class' then, so I can't test such a program now, if you mean this.
If yes, then it is worth checking what Delphi is doing.
For now I'm treating Delphi like BP here (i.e., only a warning), but if it turns out it should be an error (Chief, did you check this already?), I can change it.
Frank