> You need to use a constraint like: > > type > generic TOption<T: TObject> = record > case IsSome:boolean of > true: ( some: T ); > false: (); > end; > > Not sure why though. > > Regards, > Ryan Joseph
That would limit supported types to class instances. I'll like to avoid that. Ideally TOption type should allow any type (primitives, strings, objects, class instances, etc). -- Regards, Denis Golovan _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal