From f292ac54869e9b407a389ea75f891515ad31e07b Mon Sep 17 00:00:00 2001 From: Kacper Korban Date: Thu, 14 Nov 2024 16:15:08 +0100 Subject: [PATCH] Short circuit adding evidence params to poly functions, when there are no context bounds --- compiler/src/dotty/tools/dotc/ast/Desugar.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/src/dotty/tools/dotc/ast/Desugar.scala b/compiler/src/dotty/tools/dotc/ast/Desugar.scala index 0bf3ba71b84d..e8ebd77b0423 100644 --- a/compiler/src/dotty/tools/dotc/ast/Desugar.scala +++ b/compiler/src/dotty/tools/dotc/ast/Desugar.scala @@ -351,6 +351,7 @@ object desugar { val Function(vparams: List[untpd.ValDef] @unchecked, rhs) = fun: @unchecked val newParamss = paramssNoContextBounds(tparams :: vparams :: Nil) val params = evidenceParamBuf.toList + if params.isEmpty then return meth val boundNames = getBoundNames(params, newParamss) val recur = fitEvidenceParams(params, nme.apply, boundNames) val (paramsFst, paramsSnd) = recur(newParamss)