File tree 1 file changed +9
-2
lines changed
compiler/src/dotty/tools/dotc/core
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -2907,12 +2907,19 @@ object TypeComparer {
2907
2907
}
2908
2908
2909
2909
object TrackingTypeComparer :
2910
- enum MatchResult :
2910
+ import printing .* , Texts .*
2911
+ enum MatchResult extends Showable :
2911
2912
case Reduced (tp : Type )
2912
2913
case Disjoint
2913
2914
case Stuck
2914
2915
case NoInstance (fails : List [(Name , TypeBounds )])
2915
2916
2917
+ def toText (p : Printer ): Text = this match
2918
+ case Reduced (tp) => " Reduced(" ~ p.toText(tp) ~ " )"
2919
+ case Disjoint => " Disjoint"
2920
+ case Stuck => " Stuck"
2921
+ case NoInstance (fails) => " NoInstance(" ~ Text (fails.map(p.toText(_) ~ p.toText(_)), " , " ) ~ " )"
2922
+
2916
2923
class TrackingTypeComparer (initctx : Context ) extends TypeComparer (initctx) {
2917
2924
import TrackingTypeComparer .*
2918
2925
@@ -2976,7 +2983,7 @@ class TrackingTypeComparer(initctx: Context) extends TypeComparer(initctx) {
2976
2983
}
2977
2984
2978
2985
/** Match a single case. */
2979
- def matchCase (cas : Type ): MatchResult = trace(i " match case $cas vs $scrut " , matchTypes) {
2986
+ def matchCase (cas : Type ): MatchResult = trace(i " $scrut match ${ MatchTypeTrace .caseText(cas)} " , matchTypes, show = true ) {
2980
2987
val cas1 = cas match {
2981
2988
case cas : HKTypeLambda =>
2982
2989
caseLambda = constrained(cas)
You can’t perform that action at this time.
0 commit comments