File tree Expand file tree Collapse file tree 2 files changed +5
-13
lines changed
src/dotty/tools/dotc/transform
test/dotty/tools/dotc/transform Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -15,16 +15,6 @@ class SpecializeFunctions extends MiniPhaseTransform with InfoTransformer {
15
15
import ast .tpd ._
16
16
val phaseName = " specializeFunctions"
17
17
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
-
28
18
/** Transforms the type to include decls for specialized applys and replace
29
19
* the class parents with specialized versions.
30
20
*/
@@ -84,7 +74,7 @@ class SpecializeFunctions extends MiniPhaseTransform with InfoTransformer {
84
74
dt.vparamss.head.map(_.symbol.info)
85
75
)
86
76
87
- val specializedApply = tree.symbol.enclosingClass.info.decls.lookup(specName)// member(specName).symbol
77
+ val specializedApply = tree.symbol.enclosingClass.info.decls.lookup(specName)
88
78
89
79
if (specializedApply.exists) {
90
80
val apply = specializedApply.asTerm
Original file line number Diff line number Diff line change @@ -60,8 +60,8 @@ class SpecializeFunctionsTests extends DottyBytecodeTest {
60
60
apps.length == 3 ,
61
61
s " Wrong number of specialized applys, actual length: ${apps.length} - $apps"
62
62
)
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" )
65
65
}
66
66
}
67
67
@@ -91,6 +91,7 @@ class SpecializeFunctionsTests extends DottyBytecodeTest {
91
91
|}""" .stripMargin
92
92
93
93
checkBCode(source) { dir =>
94
+ // No specialization for Function1[Char, Int]
94
95
assertBoxing(" <init>" , findClass(" Test$" , dir).methods)
95
96
}
96
97
}
@@ -136,6 +137,7 @@ class SpecializeFunctionsTests extends DottyBytecodeTest {
136
137
|}""" .stripMargin
137
138
138
139
checkBCode(source) { dir =>
140
+ // No specialization for Function2[Char, Char, Char]
139
141
assertBoxing(" <init>" , findClass(" Test$" , dir).methods)
140
142
}
141
143
}
You can’t perform that action at this time.
0 commit comments