diff --git a/compiler/ppu.pas b/compiler/ppu.pas index 9ac2de624c..f4f7e2e853 100644 --- a/compiler/ppu.pas +++ b/compiler/ppu.pas @@ -48,7 +48,7 @@ const CurrentPPUVersion = 208; { for any other changes to the ppu format, increase this version number (it's a cardinal) } - CurrentPPULongVersion = 13; + CurrentPPULongVersion = 14; { unit flags } uf_big_endian = $000004; diff --git a/compiler/symdef.pas b/compiler/symdef.pas index 701dc6efc3..146913c2f2 100644 --- a/compiler/symdef.pas +++ b/compiler/symdef.pas @@ -7431,7 +7431,7 @@ implementation if objecttype in [odt_interfacecorba,odt_interfacecom,odt_dispinterface] then prepareguid; { setup implemented interfaces } - if objecttype in [odt_class,odt_objcclass,odt_objcprotocol,odt_javaclass,odt_interfacejava] then + if objecttype in [odt_class,odt_objcclass,odt_objcprotocol,odt_objccategory,odt_javaclass,odt_interfacejava] then ImplementedInterfaces:=TFPObjectList.Create(true) else ImplementedInterfaces:=nil; @@ -7489,7 +7489,7 @@ implementation end; { load implemented interfaces } - if objecttype in [odt_class,odt_objcclass,odt_objcprotocol,odt_javaclass,odt_interfacejava] then + if objecttype in [odt_class,odt_objcclass,odt_objcprotocol,odt_objccategory,odt_javaclass,odt_interfacejava] then begin ImplementedInterfaces:=TFPObjectList.Create(true); implintfcount:=ppufile.getlongint; diff --git a/tests/webtbs/tw39375.pp b/tests/webtbs/tw39375.pp new file mode 100644 index 0000000000..04fe2fdf3b --- /dev/null +++ b/tests/webtbs/tw39375.pp @@ -0,0 +1,31 @@ +{ %target=darwin,ios,iphonesim } + +program Project1; +{$mode objfpc}{$H+} +{$ModeSwitch objectivec1} +type +CBCentralManager = pointer; +CBCentralManagerDelegateProtocol = objcprotocol external + procedure centralManagerDidUpdateState (central: CBCentralManager); message 'centralManagerDidUpdateState:'; +end; + +Test=objccategory(NSObject,CBCentralManagerDelegateProtocol) +procedure centralManagerDidUpdateState (central: CBCentralManager); +end; + +var + called: boolean = false; + +procedure Test.centralManagerDidUpdateState (central: CBCentralManager); +begin + called:=true; +end; + +var + o: NSObject; +begin + o := NSObject.alloc.init; + o.centralManagerDidUpdateState(nil); + if not called then + halt(1); +end.