mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-03 03:38:37 +02:00

default value (mantis #22343) * give an error when specifying an invalid default value (e.g. a floating point number for a longint parameter) git-svn-id: trunk@22021 -
23 lines
353 B
ObjectPascal
23 lines
353 B
ObjectPascal
{ %fail }
|
||
|
||
{$IFDEF FPC}
|
||
{$MODE DELPHI}
|
||
{$ENDIF}
|
||
|
||
type
|
||
TWrapper = record
|
||
class operator Implicit(value: Integer): TWrapper;
|
||
end;
|
||
|
||
class operator TWrapper.Implicit(value: Integer): TWrapper;
|
||
begin
|
||
end;
|
||
|
||
procedure TestProcedure(const wr: TWrapper = TWrapper(0));
|
||
{ This crashes the compiler, and shouldn’t be allowed }
|
||
begin
|
||
end;
|
||
|
||
begin
|
||
end.
|