mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 16:49:07 +02:00
* 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:
parent
0757517dde
commit
1ec48299cf
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -10533,7 +10533,6 @@ tests/test/tdefault12.pp svneol=native#text/pascal
|
|||||||
tests/test/tdefault13.pp svneol=native#text/pascal
|
tests/test/tdefault13.pp svneol=native#text/pascal
|
||||||
tests/test/tdefault14.pp svneol=native#text/pascal
|
tests/test/tdefault14.pp svneol=native#text/pascal
|
||||||
tests/test/tdefault15.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/tdefault2.pp svneol=native#text/pascal
|
||||||
tests/test/tdefault3.pp svneol=native#text/pascal
|
tests/test/tdefault3.pp svneol=native#text/pascal
|
||||||
tests/test/tdefault4.pp svneol=native#text/pascal
|
tests/test/tdefault4.pp svneol=native#text/pascal
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
{ %FAIL }
|
|
||||||
{ %target=darwin }
|
{ %target=darwin }
|
||||||
|
|
||||||
{ Objective C types are disallowed as well }
|
{ Objective C types are implicit pointer types -> nil pointer }
|
||||||
program tdefault15;
|
program tdefault15;
|
||||||
|
|
||||||
{$mode objfpc}
|
{$mode objfpc}
|
||||||
@ -10,9 +9,17 @@ program tdefault15;
|
|||||||
type
|
type
|
||||||
TTest = objcclass
|
TTest = objcclass
|
||||||
end;
|
end;
|
||||||
|
TTestProto = objcprotocol
|
||||||
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
t: TTest;
|
t: TTest;
|
||||||
|
tp: TTestProto;
|
||||||
begin
|
begin
|
||||||
t := Default(TTest);
|
t := Default(TTest);
|
||||||
|
if assigned(t) then
|
||||||
|
halt(1);
|
||||||
|
tp := Default(TTestProto);
|
||||||
|
if assigned(tp) then
|
||||||
|
halt(2);
|
||||||
end.
|
end.
|
||||||
|
@ -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.
|
|
Loading…
Reference in New Issue
Block a user