Skip to content

Commit e4c376e

Browse files
authored
Merge pull request #3948 from dotty-staging/opt/posttyper-fastpath
PostTyper#normalizeTypeArgs: fast path to avoid allocations
2 parents e97ae33 + 1f4f96f commit e4c376e

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ class PostTyper extends MacroTransform with IdentityDenotTransformer { thisPhase
150150
}
151151
val (tycon, args) = decompose(tree)
152152
tycon.tpe.widen match {
153-
case tp: PolyType =>
153+
case tp: PolyType if args.exists(isNamedArg) =>
154154
val (namedArgs, otherArgs) = args.partition(isNamedArg)
155155
val args1 = reorderArgs(tp.paramNames, namedArgs.asInstanceOf[List[NamedArg]], otherArgs)
156156
TypeApply(tycon, args1).withPos(tree.pos).withType(tree.tpe)

0 commit comments

Comments
 (0)