mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-03 18:29:35 +01:00
* made all objcclasses assignment-compatible with id, and vice versa
git-svn-id: branches/objc@13170 -
This commit is contained in:
parent
a63d4e3ad0
commit
112ea5e5a8
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -7916,6 +7916,7 @@ tests/test/tmsg3.pp svneol=native#text/plain
|
||||
tests/test/tmsg4.pp svneol=native#text/plain
|
||||
tests/test/tmt1.pp svneol=native#text/plain
|
||||
tests/test/tobjc1.pp svneol=native#text/plain
|
||||
tests/test/tobjc2.pp svneol=native#text/plain
|
||||
tests/test/tobject1.pp svneol=native#text/plain
|
||||
tests/test/tobject2.pp svneol=native#text/plain
|
||||
tests/test/tobject3.pp svneol=native#text/plain
|
||||
|
||||
@ -1121,6 +1121,12 @@ implementation
|
||||
begin
|
||||
doconv:=tc_equal;
|
||||
eq:=te_convert_l2;
|
||||
end
|
||||
else if is_objcclass(def_from) and
|
||||
(def_to=objc_idtype) then
|
||||
begin
|
||||
doconv:=tc_equal;
|
||||
eq:=te_convert_l1;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -1282,7 +1288,14 @@ implementation
|
||||
doconv:=tc_int_2_int;
|
||||
eq:=te_convert_l1;
|
||||
end;
|
||||
end;
|
||||
end
|
||||
else if is_objcclass(def_to) and
|
||||
(def_from=objc_idtype) then
|
||||
begin
|
||||
{ All Objective-C classes are compatible with ID }
|
||||
doconv:=tc_equal;
|
||||
eq:=te_convert_l1;
|
||||
end;
|
||||
end;
|
||||
|
||||
classrefdef :
|
||||
|
||||
14
tests/test/tobjc2.pp
Normal file
14
tests/test/tobjc2.pp
Normal file
@ -0,0 +1,14 @@
|
||||
{ %target=darwin}
|
||||
{ %cpu=powerpc,i386}
|
||||
{ %norun }
|
||||
|
||||
{$mode objfpc}
|
||||
{$modeswitch objectivec1}
|
||||
|
||||
var
|
||||
a: NSObject;
|
||||
b: id;
|
||||
begin
|
||||
a:=b;
|
||||
b:=a;
|
||||
end.
|
||||
Loading…
Reference in New Issue
Block a user