pub(crate) fn expected_function( ctx: &DiagnosticsContext<'_, '_>, d: &ExpectedFunction<'_>, ) -> Diagnostic