* 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 -
This commit is contained in:
Jonas Maebe 2012-05-22 11:07:05 +00:00
parent 0757517dde
commit 1ec48299cf
3 changed files with 9 additions and 21 deletions

1
.gitattributes vendored
View File

@ -10533,7 +10533,6 @@ tests/test/tdefault12.pp svneol=native#text/pascal
tests/test/tdefault13.pp svneol=native#text/pascal
tests/test/tdefault14.pp svneol=native#text/pascal
tests/test/tdefault15.pp svneol=native#text/pascal
tests/test/tdefault16.pp svneol=native#text/pascal
tests/test/tdefault2.pp svneol=native#text/pascal
tests/test/tdefault3.pp svneol=native#text/pascal
tests/test/tdefault4.pp svneol=native#text/pascal

View File

@ -1,7 +1,6 @@
{ %FAIL }
{ %target=darwin }
{ Objective C types are disallowed as well }
{ Objective C types are implicit pointer types -> nil pointer }
program tdefault15;
{$mode objfpc}
@ -10,9 +9,17 @@ program tdefault15;
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.

View File

@ -1,18 +0,0 @@
{ %FAIL }
{ %target=darwin }
{ Objective C types are disallowed as well }
program tdefault16;
{$mode objfpc}
{$modeswitch objectivec1}
type
TTest = objcprotocol
end;
var
t: TTest;
begin
t := Default(TTest);
end.