[fpc-pascal] Generics in Objective-C mode bug?

Ryan Joseph genericptr at gmail.com
Mon Nov 11 19:08:29 CET 2019


Is this a bug I should report? Knowing what I do about generics now I think the type check needs to be suspended until the type is actually specialized.


{$mode objfpc}
{$modeswitch objectivec2}

program test;

type
  generic TCocoaObject<T> = objcclass (NSObject)
    // ERROR: The type "TCocoaObject$1.T" is not supported for interaction with the Objective-C and the blocks runtime.
    m_obj: T;
    function obj: T; message 'obj';
  end;

function TCocoaObject.obj: T;
begin
  result := m_obj;
end;

begin
end.


Regards,
	Ryan Joseph



More information about the fpc-pascal mailing list