Skip to content

Commit b3c6071

Browse files
szymon-rdKordyjan
authored andcommitted
Replace for with exists in isTransparentInline in WUNused
1 parent fd49eb6 commit b3c6071

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

+2-4
Original file line numberDiff line numberDiff line change
@@ -505,13 +505,11 @@ object CheckUnused:
505505
* Checks if import selects a def that is transparent and inline
506506
*/
507507
private def isTransparentAndInline(imp: tpd.Import)(using Context): Boolean =
508-
(for {
509-
sel <- imp.selectors
510-
} yield {
508+
imp.selectors.exists { sel =>
511509
val qual = imp.expr
512510
val importedMembers = qual.tpe.member(sel.name).alternatives.map(_.symbol)
513511
importedMembers.exists(s => s.is(Transparent) && s.is(Inline))
514-
}).exists(identity)
512+
}
515513

516514
/**
517515
* Heuristic to detect synthetic suffixes in names of symbols

0 commit comments

Comments
 (0)