Skip to content

Commit 024a2ca

Browse files
committed
Remove unnecessary conditions
1 parent cc77000 commit 024a2ca

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

compiler/src/dotty/tools/dotc/typer/Inliner.scala

+6-7
Original file line numberDiff line numberDiff line change
@@ -1230,13 +1230,12 @@ class Inliner(call: tpd.Tree, rhsToInline: tpd.Tree)(implicit ctx: Context) {
12301230
countRefs.traverse(tree)
12311231
for (binding <- bindings) countRefs.traverse(binding)
12321232

1233-
def retain(boundSym: Symbol) = {
1234-
!boundSym.is(Inline) &&
1235-
(refCount.get(boundSym) match {
1236-
case Some(x) => x > 1 || x == 1 && !boundSym.is(Method)
1237-
case none => true
1238-
})
1239-
} && !(boundSym.isAllOf(InlineMethod) && boundSym.isOneOf(GivenOrImplicit)) // TODO clenup unnecessary conditions?
1233+
def retain(boundSym: Symbol) =
1234+
!boundSym.is(Inline) && {
1235+
refCount.get(boundSym) match
1236+
case Some(x) => x > 1 || x == 1 && !boundSym.is(Method)
1237+
case none => true
1238+
}
12401239

12411240
val inlineBindings = new TreeMap {
12421241
override def transform(t: Tree)(implicit ctx: Context) = t match {

0 commit comments

Comments
 (0)