Move Expression::discardValue into a free function
Merge pull request #3233 from yebblies/discardvalue

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