[fpc-pascal] Generics in Objective Pascal?
zoe at scootersoftware.com
Sun Nov 1 16:45:08 CET 2020
I'd like to have a generic objcclass that would add some extra
functionality for multiple base types. I don't have a lot of experience
with generics, but this compiles:
generic TMyControl<T: TWinControl> = class(T)
TMyEdit = specialize TMyControl<TEdit>;
and this fails with the error 'Class or interface type expected, but got
generic NSMyView<T: NSView> = objcclass(T)
procedure Foo; message 'Foo:';
The documentation doesn't mention it, so I'm assuming it's just not
implemented. Is that something that could be supported? Would it be
difficult to do so? Are there any existing Objective Pascal specific
tricks I could use to avoid duplicating all of the fields/code?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fpc-pascal