Skip to content

Commit 0827f5e

Browse files
committed
make derivedFlexibleType reuse this when unchanged
1 parent dcc3c17 commit 0827f5e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3365,7 +3365,7 @@ object Types {
33653365
override def show(using Context) = "FlexibleType("+tp.show+")"
33663366
def underlying(using Context) : Type = this.tp
33673367
def derivedFlexibleType(under: Type)(using Context): Type =
3368-
FlexibleType(under)
3368+
if this.tp eq under then this else FlexibleType(under)
33693369
override def computeHash(bs: Binders): Int = doHash(bs, tp)
33703370
override def toString = "FlexibleType(%s)".format(tp)
33713371
//override def hash = NotCached

0 commit comments

Comments
 (0)