In Delphi mode, the ^ (caret) operator permits ambiguous type definitions
Original Reporter info from Mantis: jcchu
-
Reporter name: JC Chu
Original Reporter info from Mantis: jcchu
- Reporter name: JC Chu
Description:
A ^ (caret) operator is placed in front of a type identifier to denote the corresponding pointer type. The way it’s currently implemented in Delphi mode allows for ambiguous type definitions. Consider the following example, where the value type corresponding to AmbiguousPointer is unclear.
{$MODE DELPHI}
type
TWrapper<P, Q> = record end;
TWrapper<R> = record end;
AmbiguousPointer = ^TWrapper;
var
Z: AmbiguousPointer;
begin
end.
^TWrapper should be allowed only if TWrapper (non-parameterized) has been defined.
This issue is related to #22220 (closed).
Mantis conversion info:
- Mantis ID: 22219
- OS: Windows NT
- OS Build: 6.1.7601
- Platform: x86_64
- Version: 2.7.1
- Fixed in version: 3.0.0
- Fixed in revision: 21687 (#8c95ea03)