summaryrefslogtreecommitdiff
path: root/tests/test/tdefault15.pp
blob: 2c65df740b190cd79b9f40ea61d6a3f41978a197 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
{ %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.