Skip to content

Commit a112315

Browse files
committed
Cleanup
1 parent f0d2719 commit a112315

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

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

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@ class SpecializeFunctions extends MiniPhaseTransform with InfoTransformer {
1515
import ast.tpd._
1616
val phaseName = "specializeFunctions"
1717

18-
private[this] var _blacklistedSymbols: List[Symbol] = _
19-
20-
private def blacklistedSymbols(implicit ctx: Context): List[Symbol] = {
21-
if (_blacklistedSymbols eq null) _blacklistedSymbols = List(
22-
ctx.getClassIfDefined("scala.math.Ordering").asClass.membersNamed("Ops".toTypeName).first.symbol
23-
)
24-
25-
_blacklistedSymbols
26-
}
27-
2818
/** Transforms the type to include decls for specialized applys and replace
2919
* the class parents with specialized versions.
3020
*/
@@ -84,7 +74,7 @@ class SpecializeFunctions extends MiniPhaseTransform with InfoTransformer {
8474
dt.vparamss.head.map(_.symbol.info)
8575
)
8676

87-
val specializedApply = tree.symbol.enclosingClass.info.decls.lookup(specName)//member(specName).symbol
77+
val specializedApply = tree.symbol.enclosingClass.info.decls.lookup(specName)
8878

8979
if (specializedApply.exists) {
9080
val apply = specializedApply.asTerm

compiler/test/dotty/tools/dotc/transform/SpecializeFunctionsTests.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ class SpecializeFunctionsTests extends DottyBytecodeTest {
6060
apps.length == 3,
6161
s"Wrong number of specialized applys, actual length: ${apps.length} - $apps"
6262
)
63-
assert(apps.contains("apply"), "Func3 did not contain `apply` forwarder method")
64-
assert(apps.contains("apply$mcIII$sp"), "Func3 did not contain specialized apply")
63+
assert(apps.contains("apply"), "Func2 did not contain `apply` forwarder method")
64+
assert(apps.contains("apply$mcIII$sp"), "Func2 did not contain specialized apply")
6565
}
6666
}
6767

@@ -91,6 +91,7 @@ class SpecializeFunctionsTests extends DottyBytecodeTest {
9191
|}""".stripMargin
9292

9393
checkBCode(source) { dir =>
94+
// No specialization for Function1[Char, Int]
9495
assertBoxing("<init>", findClass("Test$", dir).methods)
9596
}
9697
}
@@ -136,6 +137,7 @@ class SpecializeFunctionsTests extends DottyBytecodeTest {
136137
|}""".stripMargin
137138

138139
checkBCode(source) { dir =>
140+
// No specialization for Function2[Char, Char, Char]
139141
assertBoxing("<init>", findClass("Test$", dir).methods)
140142
}
141143
}

0 commit comments

Comments
 (0)