Tested with DMD 2.058head. auto dg = cast(int function(int))(a)=>a; Error: cannot cast __lambda2 The code should compile.
https://github.com/D-Programming-Language/dmd/pull/593