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 @@ -3007,12 +3007,19 @@ object TypeComparer {
3007
3007
}
3008
3008
3009
3009
object TrackingTypeComparer :
3010
- enum MatchResult :
3010
+ import printing .* , Texts .*
3011
+ enum MatchResult extends Showable :
3011
3012
case Reduced (tp : Type )
3012
3013
case Disjoint
3013
3014
case Stuck
3014
3015
case NoInstance (fails : List [(Name , TypeBounds )])
3015
3016
3017
+ def toText (p : Printer ): Text = this match
3018
+ case Reduced (tp) => " Reduced(" ~ p.toText(tp) ~ " )"
3019
+ case Disjoint => " Disjoint"
3020
+ case Stuck => " Stuck"
3021
+ case NoInstance (fails) => " NoInstance(" ~ Text (fails.map(p.toText(_) ~ p.toText(_)), " , " ) ~ " )"
3022
+
3016
3023
class TrackingTypeComparer (initctx : Context ) extends TypeComparer (initctx) {
3017
3024
import TrackingTypeComparer .*
3018
3025
@@ -3076,7 +3083,7 @@ class TrackingTypeComparer(initctx: Context) extends TypeComparer(initctx) {
3076
3083
}
3077
3084
3078
3085
/** Match a single case. */
3079
- def matchCase (cas : Type ): MatchResult = trace(i " match case $cas vs $scrut " , matchTypes) {
3086
+ def matchCase (cas : Type ): MatchResult = trace(i " $scrut match ${ MatchTypeTrace .caseText(cas)} " , matchTypes, show = true ) {
3080
3087
val cas1 = cas match {
3081
3088
case cas : HKTypeLambda =>
3082
3089
caseLambda = constrained(cas)
You can’t perform that action at this time.
0 commit comments