Skip to content

Commit f82a60a

Browse files
committed
Make SimpleIdentitySets showable
1 parent 62a6513 commit f82a60a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler/src/dotty/tools/dotc/printing/Formatting.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import core.*
88
import Texts.*, Types.*, Flags.*, Symbols.*, Contexts.*
99
import Decorators.*
1010
import reporting.Message
11-
import util.DiffUtil
11+
import util.{DiffUtil, SimpleIdentitySet}
1212
import Highlighting.*
1313

1414
object Formatting {
@@ -87,6 +87,9 @@ object Formatting {
8787
def show(x: H *: T) =
8888
CtxShow(toStr(x.head) *: toShown(x.tail).asInstanceOf[Tuple])
8989

90+
given [X <: AnyRef: Show]: Show[SimpleIdentitySet[X]] with
91+
def show(x: SimpleIdentitySet[X]) = summon[Show[List[X]]].show(x.toList)
92+
9093
given Show[FlagSet] with
9194
def show(x: FlagSet) = x.flagsString
9295

0 commit comments

Comments
 (0)