This code no longer compiles with latest Elements compiler (13.x)
unit System_;
interface
type
// Bound to objects
CObject = public Object;
// TPropertyFilterFunc = reference to function (const AProperty: String) : Boolean;
CObjectTypeHelper = public extension class(CObject)
public
class function &From<T>(const Value: T): CObject; overload;
end;
implementation
class function CObjectTypeHelper.&From<T>(const Value: T): CObject;
begin
Result := T(Value);
end;
end.
Error: (E62) Type mismatch, cannot assign “T” to “CObject”
This code did compile using Elements 12.X