Prevent lambdas from crashing if given implicit generic parameters.

These changes fix issue #599 and #641 . Now, instead of crashing the compiler, lambdas with generic types merely cause type errors during compilation.