Skip to content

Commit a0c3469

Browse files
committed
Improve performance of FunctionOf.unapply
1 parent 45e08cb commit a0c3469

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)