You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
voidprint(llvm::raw_ostream &out) const {
bool hasNonDefault = false;
for (unsignedint i = 0; i < NumScoreKinds; ++i) {
if (Data[i] != 0) {
out << " [component: ";
out << "#";
out << std::to_string(i);
out << "";
out << getNameFor(ScoreKind(i));
out << "(s), value: ";
out << std::to_string(Data[i]);
out << "]";
hasNonDefault = true;
}
}
if (!hasNonDefault) {
out << " <default ";
out << *this;
out << ">";
}
}
Alternatives considered
Restore the score format used before these PRs were implemented.
Motivation
Environment
In current score label in the debug output,
We cannot easily recognize which score is more impactful.
Full Output
We cannot recognize which is more/less impactful between
value to optional promotion
ofSolution#0
andempty-existential conversion
ofSolution#1
.In Addition, Since
Solution
isvalue-to-pointer conversion(s)
, We can guessvalue-to-pointer conversion
is least impactful, but it is also ambiguous.Proposed solution
Add the number indicates impactful in the debug output. We can recognize which score is more/less impactful comparing the number.
I think these format is also good.
I think It will be easy to implement this feature.
https://github.com/hborla/swift/blob/6676fbfd19781dd6ed1d59bb84146aff336c24d4/include/swift/Sema/ConstraintSystem.h#L1152
Alternatives considered
Restore the score format used before these PRs were implemented.
#60387
#60927
However, I think it is better to show name of component. So I propose mixed format showing name and number.
Additional information
If it is acceptable, I'd like to challenge creating PR by myself 😎 (It's my first time to contribute).
The text was updated successfully, but these errors were encountered: