@@ -697,10 +697,10 @@ static void printRejectedCandidates(ErrorWriterBase& wr,
697
697
!offendingActual->typeExpression ()) {
698
698
auto formalKind = badPass.formalType ().kind ();
699
699
auto actualName = " '" + actualExpr->toIdentifier ()->name ().str () + " '" ;
700
- wr.message ( " The actual " , actualName,
700
+ wr.note (offendingActual-> id (), " The actual " , actualName,
701
701
" expects to be split-initialized because it is declared without a type or initialization expression here:" );
702
702
wr.codeForDef (offendingActual);
703
- wr.message ( " The call to '" , ci.name () ," ' occurs before any valid initialization points:" );
703
+ wr.note (actualExpr, " The call to '" , ci.name () ," ' occurs before any valid initialization points:" );
704
704
wr.code (actualExpr, { actualExpr });
705
705
actualPrinted = true ;
706
706
wr.message (" The call to '" , ci.name (), " ' cannot initialize " ,
@@ -2413,6 +2413,17 @@ void ErrorUseOfLaterVariable::write(ErrorWriterBase& wr) const {
2413
2413
wr.message (" Variables cannot be referenced before they are defined." );
2414
2414
}
2415
2415
2416
+
2417
+ void ErrorVariableWithoutInitOrType::write (ErrorWriterBase& wr) const {
2418
+ auto stmt = std::get<const uast::AstNode*>(info_);
2419
+ auto & node = std::get<ID>(info_);
2420
+ auto name = std::get<UniqueString>(info_);
2421
+ wr.heading (kind_, type_, stmt,
2422
+ " variable '" , name, " ' is declared without an initializer or type." );
2423
+ wr.note (node, " cannot find initialization point to split-init this variable" );
2424
+ wr.codeForLocation (node);
2425
+ }
2426
+
2416
2427
void ErrorUserDiagnosticEncounterError::write (ErrorWriterBase& wr) const {
2417
2428
auto msg = std::get<UniqueString>(info_);
2418
2429
auto & node = std::get<ID>(info_);
0 commit comments