Skip to content

Commit 18df4ed

Browse files
Improve performance of FunctionOf.unapply (#18291)
2 parents 1dc9761 + a0c3469 commit 18df4ed

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,10 +1119,10 @@ class Definitions {
11191119
ft.dealias match
11201120
case ErasedFunctionOf(mt) =>
11211121
Some(mt.paramInfos, mt.resType, mt.isContextualMethod)
1122-
case _ =>
1123-
val tsym = ft.dealias.typeSymbol
1122+
case dft =>
1123+
val tsym = dft.typeSymbol
11241124
if isFunctionSymbol(tsym) && ft.isRef(tsym) then
1125-
val targs = ft.dealias.argInfos
1125+
val targs = dft.argInfos
11261126
if (targs.isEmpty) None
11271127
else Some(targs.init, targs.last, tsym.name.isContextFunction)
11281128
else None

0 commit comments

Comments
 (0)