Allow using lambdas within enums.

Fixes bug 659778