These methods can be simplified a bunch since the returned decl is always the input decl and we can refactor the lambdas to just return the auxiliary variable and have the type computation in the caller.
DiagnosticsParse.def
lazy
DiagnosticsSema.def
diag::type_of_expression_is_ambiguous
DescriptiveDeclKind
DiagnosticsCommon.def