Skip to content

Commit ab66e26

Browse files
committed
Avoid repeated calls to Symbol.info
1 parent c602727 commit ab66e26

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/compiler/scala/tools/nsc/transform/Erasure.scala

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -825,8 +825,9 @@ abstract class Erasure extends InfoTransform
825825
case Ident(_) | Select(_, _) =>
826826
if (tree1.symbol.isOverloaded) {
827827
val first = tree1.symbol.alternatives.head
828+
val firstTpe = first.tpe
828829
val sym1 = tree1.symbol.filter {
829-
alt => alt == first || !(first.tpe looselyMatches alt.tpe)
830+
alt => alt == first || !(firstTpe looselyMatches alt.tpe)
830831
}
831832
if (tree.symbol ne sym1) {
832833
tree1 setSymbol sym1 setType sym1.tpe

0 commit comments

Comments
 (0)