@@ -2274,7 +2274,7 @@ bool AssignmentFailure::diagnoseAsError() {
22742274
22752275 if (foundProperty != results.end ()) {
22762276 auto startLoc = immutableExpr->getStartLoc ();
2277- auto *property = *foundProperty;
2277+ auto *property = cast<VarDecl>( *foundProperty) ;
22782278 auto selfTy = typeContext->getSelfTypeInContext ();
22792279
22802280 // If we found an instance property, suggest inserting "self.",
@@ -2286,7 +2286,7 @@ bool AssignmentFailure::diagnoseAsError() {
22862286 fixItText = selfTy->getString () + " ." ;
22872287 }
22882288 emitDiagnosticAt (startLoc, diag::masked_mutable_property, fixItText,
2289- property-> getDescriptiveKind () , selfTy)
2289+ property, selfTy)
22902290 .fixItInsert (startLoc, fixItText);
22912291 }
22922292 }
@@ -3565,9 +3565,8 @@ bool ContextualFailure::tryProtocolConformanceFixIt(
35653565
35663566 // Emit a diagnostic to inform the user that they need to conform to the
35673567 // missing protocols.
3568- auto conformanceDiag =
3569- emitDiagnostic (diag::assign_protocol_conformance_fix_it, constraint,
3570- nominal->getDescriptiveKind (), fromType);
3568+ auto conformanceDiag = emitDiagnostic (
3569+ diag::assign_protocol_conformance_fix_it, constraint, nominal);
35713570 if (!nominal->getInherited ().empty ()) {
35723571 auto lastInheritedEndLoc = nominal->getInherited ().getEndLoc ();
35733572 conformanceDiag.fixItInsertAfter (lastInheritedEndLoc, " , " + protoString);
@@ -6461,7 +6460,7 @@ bool InvalidMutatingMethodRefInKeyPath::diagnoseAsError() {
64616460}
64626461
64636462bool InvalidAsyncOrThrowsMethodRefInKeyPath::diagnoseAsError () {
6464- emitDiagnostic (diag::effectful_keypath_component, getKind (),
6463+ emitDiagnostic (diag::effectful_keypath_component, getMember (),
64656464 isForKeyPathDynamicMemberLookup ());
64666465 return true ;
64676466}
@@ -7242,10 +7241,10 @@ bool InvalidTupleSplatWithSingleParameterFailure::diagnoseAsError() {
72427241 name.isSpecial ()
72437242 ? emitDiagnosticAt (args->getLoc (),
72447243 diag::single_tuple_parameter_mismatch_special,
7245- choice-> getDescriptiveKind () , paramTy, subsStr)
7246- : emitDiagnosticAt (
7247- args-> getLoc (), diag::single_tuple_parameter_mismatch_normal,
7248- choice, paramTy, subsStr);
7244+ choice, paramTy, subsStr)
7245+ : emitDiagnosticAt (args-> getLoc (),
7246+ diag::single_tuple_parameter_mismatch_normal,
7247+ choice, paramTy, subsStr);
72497248
72507249 auto newLeftParenLoc = args->getStartLoc ();
72517250 auto firstArgLabel = args->getLabel (0 );
@@ -8442,7 +8441,8 @@ bool MissingQualifierInMemberRefFailure::diagnoseAsError() {
84428441 return true ;
84438442 }
84448443
8445- auto qualifier = DC->getParentModule ()->getName ();
8444+ auto *module = DC->getParentModule ();
8445+ auto qualifier = module ->getName ();
84468446
84478447 emitDiagnostic (diag::member_shadows_global_function, UDE->getName (),
84488448 methodKind, choice, qualifier);
@@ -8451,7 +8451,7 @@ bool MissingQualifierInMemberRefFailure::diagnoseAsError() {
84518451 namePlusDot.push_back (' .' );
84528452
84538453 emitDiagnostic (diag::fix_unqualified_access_top_level_multi, namePlusDot,
8454- choice-> getDescriptiveKind (), qualifier )
8454+ choice, module )
84558455 .fixItInsert (UDE->getStartLoc (), namePlusDot);
84568456
84578457 emitDiagnosticAt (choice, diag::decl_declared_here, choice);
0 commit comments