Casting interfaces to objects
Syntax
It is now possible to cast an interface variable directly to a class variable using either safe or unsafe typecasts.
type
  TPerson = class(TObject, ISwimmer)
    ...
  end;
...
var
  swimmer : ISwimmer;
  person : TPerson;
begin
  swimmer := TPerson.Create;
  person := swimmer as TPerson;
  person := TPerson(swimmer);
Notes
  • Previously this was done either through hackery of the Hallvard Vassbotn kind or by adding a function that returned the object type to the interface definition.
  • I find this very useful when unit testing code that uses interfaces.
Further reading
Allen Bauer (Emb.) on the inner workings of this feature.
http://blogs.embarcadero.com/abauer/2009/08/21/38893
Malcolm Groves (Emb.) introduces casting interfaces to objects.
http://www.malcolmgroves.com/blog/?p=500
Barry Kelly shows how to cast an interface to an object prior to the release of this feature.
http://blog.barrkel.com/2011/03/ugly-alternative-to-interface-to-object.html
Hallvard Vassbotn shows another way to cast an interface to an object for earlier versions of Delphi.
http://hallvards.blogspot.com/2004/07/hack-7-interface-to-object-in-delphi.html