Skip to content

Commit 24080f1

Browse files
szymon-rdKordyjan
authored andcommitted
Replace for with exists in isTransparentInline in WUNused
1 parent 432e829 commit 24080f1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -512,13 +512,11 @@ object CheckUnused:
512512
* Checks if import selects a def that is transparent and inline
513513
*/
514514
private def isTransparentAndInline(imp: tpd.Import)(using Context): Boolean =
515-
(for {
516-
sel <- imp.selectors
517-
} yield {
515+
imp.selectors.exists { sel =>
518516
val qual = imp.expr
519517
val importedMembers = qual.tpe.member(sel.name).alternatives.map(_.symbol)
520518
importedMembers.exists(s => s.is(Transparent) && s.is(Inline))
521-
}).exists(identity)
519+
}
522520

523521
/**
524522
* Heuristic to detect synthetic suffixes in names of symbols

0 commit comments

Comments
 (0)