class A {} class B extends A {} class C { B f() {return null;} void bar () { A a = f(); } }