Skip to content

Commit 674d375

Browse files
committed
Performance tweak: touch fewer Apply nodes
1 parent f26e981 commit 674d375

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/transform/SpecializeFunctions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ class SpecializeFunctions extends MiniPhase with InfoTransformer {
109109
/** Dispatch to specialized `apply`s in user code when available */
110110
override def transformApply(tree: Apply)(using Context) =
111111
tree match {
112-
case Apply(fun, args) if fun.symbol.name == nme.apply =>
112+
case Apply(fun: NameTree, args) if fun.name == nme.apply && args.size <= 3 =>
113113
val argTypes = fun.tpe.widen.firstParamTypes.map(_.widenSingleton.dealias)
114114
val retType = tree.tpe.widenSingleton.dealias
115115
val isSpecializable =

0 commit comments

Comments
 (0)