mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-31 09:50:22 +02:00
* don't automatically set the parent class of objcclasses without a
designated parent to NSObject, because you can have multiple root classes (e.g., NSProxy is also an Objective-C root class in Cocoa). Instead, give a hint when an Objective-C class is declared without any parent (because it can very well be a mistake, given that Pascal classes all do automatically inherit form TObject). git-svn-id: branches/objc@13177 -
This commit is contained in:
parent
5691da116f
commit
ba2c2cd449
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -7917,6 +7917,7 @@ tests/test/tmsg4.pp svneol=native#text/plain
|
|||||||
tests/test/tmt1.pp svneol=native#text/plain
|
tests/test/tmt1.pp svneol=native#text/plain
|
||||||
tests/test/tobjc1.pp svneol=native#text/plain
|
tests/test/tobjc1.pp svneol=native#text/plain
|
||||||
tests/test/tobjc2.pp svneol=native#text/plain
|
tests/test/tobjc2.pp svneol=native#text/plain
|
||||||
|
tests/test/tobjc3.pp svneol=native#text/plain
|
||||||
tests/test/tobject1.pp svneol=native#text/plain
|
tests/test/tobject1.pp svneol=native#text/plain
|
||||||
tests/test/tobject2.pp svneol=native#text/plain
|
tests/test/tobject2.pp svneol=native#text/plain
|
||||||
tests/test/tobject3.pp svneol=native#text/plain
|
tests/test/tobject3.pp svneol=native#text/plain
|
||||||
|
@ -299,8 +299,7 @@ implementation
|
|||||||
if current_objectdef<>interface_iunknown then
|
if current_objectdef<>interface_iunknown then
|
||||||
childof:=interface_iunknown;
|
childof:=interface_iunknown;
|
||||||
odt_objcclass:
|
odt_objcclass:
|
||||||
if current_objectdef<>objcclass_nsobject then
|
CGMessage(parser_h_no_objc_parent);
|
||||||
childof:=objcclass_nsobject;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -667,7 +667,6 @@ interface
|
|||||||
objc_superclasstype,
|
objc_superclasstype,
|
||||||
objc_idtype,
|
objc_idtype,
|
||||||
objc_seltype : tpointerdef;
|
objc_seltype : tpointerdef;
|
||||||
objcclass_nsobject : tobjectdef;
|
|
||||||
|
|
||||||
const
|
const
|
||||||
{$ifdef i386}
|
{$ifdef i386}
|
||||||
@ -3715,12 +3714,6 @@ implementation
|
|||||||
else
|
else
|
||||||
ImplementedInterfaces:=nil;
|
ImplementedInterfaces:=nil;
|
||||||
writing_class_record_dbginfo:=false;
|
writing_class_record_dbginfo:=false;
|
||||||
|
|
||||||
{ make NSObject immediately known in the same unit }
|
|
||||||
if (childof=nil) and
|
|
||||||
(objecttype=odt_objcclass) and
|
|
||||||
(objrealname^='NSObject') then
|
|
||||||
objcclass_nsobject:=self;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -3797,10 +3790,6 @@ implementation
|
|||||||
(objecttype=odt_interfacecom) and
|
(objecttype=odt_interfacecom) and
|
||||||
(objname^='IUNKNOWN') then
|
(objname^='IUNKNOWN') then
|
||||||
interface_iunknown:=self;
|
interface_iunknown:=self;
|
||||||
if (childof=nil) and
|
|
||||||
(objecttype=odt_objcclass) and
|
|
||||||
(objrealname^='NSObject') then
|
|
||||||
objcclass_nsobject:=self;
|
|
||||||
writing_class_record_dbginfo:=false;
|
writing_class_record_dbginfo:=false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
15
tests/test/tobjc3.pp
Normal file
15
tests/test/tobjc3.pp
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{ %fail }
|
||||||
|
{ %opt=-vh -Seh }
|
||||||
|
{ %target=darwin }
|
||||||
|
{ %cpu=powerpc,i386 }
|
||||||
|
|
||||||
|
{$modeswitch objectivec1}
|
||||||
|
|
||||||
|
type
|
||||||
|
{ should produce a hint that ta does not automatically derive from any
|
||||||
|
other class }
|
||||||
|
ta = objcclass
|
||||||
|
end; external;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user