Skip to content

Commit 6544215

Browse files
committed
make derivedFlexibleType reuse this when unchanged
1 parent 0655707 commit 6544215

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
@@ -3341,7 +3341,7 @@ object Types {
33413341
override def show(using Context) = "FlexibleType("+tp.show+")"
33423342
def underlying(using Context) : Type = this.tp
33433343
def derivedFlexibleType(under: Type)(using Context): Type =
3344-
FlexibleType(under)
3344+
if this.tp eq under then this else FlexibleType(under)
33453345
override def computeHash(bs: Binders): Int = doHash(bs, tp)
33463346
override def toString = "FlexibleType(%s)".format(tp)
33473347
//override def hash = NotCached

0 commit comments

Comments
 (0)