Skip to content

Commit 95e5440

Browse files
author
Amritpan Kaur
committed
[ConstraintSystem] Edit ScoreKind descriptions and print ScoreKind increase values.
1 parent 31f3a1a commit 95e5440

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

include/swift/Sema/ConstraintSystem.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ struct Score {
10161016
static std::string getNameFor(ScoreKind kind) {
10171017
switch (kind) {
10181018
case SK_Hole:
1019-
return "hole in the constraint system";
1019+
return "hole";
10201020

10211021
case SK_Unavailable:
10221022
return "use of an unavailable declaration";
@@ -1031,7 +1031,7 @@ struct Score {
10311031
return "forward scan when matching a trailing closure";
10321032

10331033
case SK_Fix:
1034-
return "attempting to fix the source";
1034+
return "applied fix";
10351035

10361036
case SK_DisfavoredOverload:
10371037
return "disfavored overload";
@@ -1055,7 +1055,7 @@ struct Score {
10551055
return "collection upcast conversion";
10561056

10571057
case SK_ValueToOptional:
1058-
return "value to optional";
1058+
return "value to optional promotion";
10591059

10601060
case SK_EmptyExistentialConversion:
10611061
return "empty-existential conversion";
@@ -1067,13 +1067,13 @@ struct Score {
10671067
return "value-to-pointer conversion";
10681068

10691069
case SK_FunctionToAutoClosureConversion:
1070-
return "function to autoclosure parameter";
1070+
return "function to autoclosure parameter conversion";
10711071

10721072
case SK_ImplicitValueConversion:
10731073
return "value-to-value conversion";
10741074

10751075
case SK_UnappliedFunction:
1076-
return "overloaded unapplied function";
1076+
return "use of overloaded unapplied function";
10771077
}
10781078
}
10791079

lib/Sema/CSRanking.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ void ConstraintSystem::increaseScore(ScoreKind kind, unsigned value) {
5555
if (isDebugMode() && value > 0) {
5656
if (solverState)
5757
llvm::errs().indent(solverState->depth * 2);
58-
llvm::errs() << "(increasing score due to " << Score::getNameFor(kind)
58+
llvm::errs() << "(increasing '" << Score::getNameFor(kind) << "' score by " << value
5959
<< ")\n";
6060
}
6161

0 commit comments

Comments
 (0)