Move Expression::toDelegate into a free function
Merge pull request #3215 from yebblies/todelegate

[DDMD] [refactor] Move Expression::toDelegate into a free function