Redmine/6569

Treat unexpanded functions and unexpanded variables equally in and/or classes promises.
Strictly speaking you know that ``result_and`` will be true and ``result_or`` will be false here, because of the optimization, so you could remove both of them altogether. No harm in leaving them though.