fpc/tests/test/tdefault15.pp
Jonas Maebe 1ec48299cf * allow default() on Objective-C classes and protocols: the compiler already
allows it, and they're plain pointer-based types -> nil is fine

git-svn-id: trunk@21360 -
2012-05-22 11:07:05 +00:00

26 lines
383 B
ObjectPascal

{ %target=darwin }
{ Objective C types are implicit pointer types -> nil pointer }
program tdefault15;
{$mode objfpc}
{$modeswitch objectivec1}
type
TTest = objcclass
end;
TTestProto = objcprotocol
end;
var
t: TTest;
tp: TTestProto;
begin
t := Default(TTest);
if assigned(t) then
halt(1);
tp := Default(TTestProto);
if assigned(tp) then
halt(2);
end.