mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2026-01-05 13:30:35 +01:00
pointer->array type conversion implies an implicit dereference operation
(mantis #25622)
git-svn-id: trunk@26608 -
24 lines
403 B
ObjectPascal
24 lines
403 B
ObjectPascal
{ %fail }
|
|
|
|
{$mode delphi}
|
|
|
|
program test;
|
|
|
|
type
|
|
TDynamicArray = array of record end; // or array of whatever
|
|
PDynamicArray = ^TDynamicArray;
|
|
|
|
function TestA(): Pointer;
|
|
begin
|
|
Result := nil;
|
|
end;
|
|
|
|
function TestB(): PDynamicArray;
|
|
begin
|
|
// can't take address of function return value, but compiler instead says "Internal error 2006111510"
|
|
Result := @TDynamicArray(TestA());
|
|
end;
|
|
|
|
begin
|
|
end.
|