Skip to content

Commit

Permalink
Add VBAR per eagle-eyed review
Browse files Browse the repository at this point in the history
  • Loading branch information
som-snytt committed Jul 29, 2022
1 parent 8774492 commit 9fe44e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
Expand Up @@ -1770,7 +1770,7 @@ abstract class RefChecks extends Transform {
// Parser adds suppressing attachment on `if (b) expr` when user has `-Wnonunit-if:false`.
def checkInterestingShapes(t: Tree): Boolean =
t match {
case If(_, thenpart, elsepart) => checkInterestingShapes(thenpart) | checkInterestingShapes(elsepart) // strict or
case If(_, thenpart, elsepart) => checkInterestingShapes(thenpart) || checkInterestingShapes(elsepart) // either or
//case Block(_, Apply(label, Nil)) if label.symbol != null && nme.isLoopHeaderLabel(label.symbol.name) => false
case Block(_, res) => checkInterestingShapes(res)
case Match(_, cases) => cases.exists(k => checkInterestingShapes(k.body))
Expand Down
6 changes: 3 additions & 3 deletions src/reflect/scala/reflect/internal/TreeInfo.scala
Expand Up @@ -363,7 +363,7 @@ abstract class TreeInfo {
case SingleType(p, sym) =>
sym == receiver.symbol || argss.exists(_.exists(sym == _.symbol))
case _ =>
def check(sym: Symbol): Boolean =
def checkSingle(sym: Symbol): Boolean =
(sym == receiver.symbol) || {
receiver match {
case Apply(_, _) => Precedence(op.decoded).level == 0 // xs(i) += x
Expand All @@ -374,8 +374,8 @@ abstract class TreeInfo {
@tailrec def loop(mt: Type): Boolean = mt match {
case MethodType(_, restpe) =>
restpe match {
case ThisType(sym) => check(sym)
case SingleType(_, sym) => check(sym)
case ThisType(sym) => checkSingle(sym)
case SingleType(_, sym) => checkSingle(sym)
case _ => loop(restpe)
}
case PolyType(_, restpe) => loop(restpe)
Expand Down

0 comments on commit 9fe44e8

Please sign in to comment.