[ConstraintSystem] Improve score label in the debug output so that we can easily recognize which score is more/less impactful. #72842
Labels
expressions
Feature: expressions
feature
A feature request or implementation
type checker
Area → compiler: Semantic analysis
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
.We can guess
empty-existential conversion(s)
is less impactful, since final Solution isSolution#1
but it is 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: