Skip to content

Commit af3bfba

Browse files
committed
Removed useless ValDef flagged by @samuelgruetter in previous pull request
1 parent 9e25a62 commit af3bfba

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@ class Typer extends Namer with Applications with Implicits {
138138
}
139139
val where = if (ctx.owner.exists) s" from ${ctx.owner.enclosingClass}" else ""
140140
val whyNot = new StringBuffer
141-
val addendum =
142-
alts foreach (_.isAccessibleFrom(pre, superAccess, whyNot))
141+
alts foreach (_.isAccessibleFrom(pre, superAccess, whyNot))
143142
if (!tpe.isError)
144143
ctx.error(i"$what cannot be accessed as a member of $pre$where.$whyNot", pos)
145144
ErrorType

tests/pos/overloadedAccess.scala

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
object overloadedAccess {
2+
3+
trait ST {
4+
def f(x: Object): Int = 1
5+
def f(x: Int): Unit = ()
6+
}
7+
8+
object O extends ST {
9+
def f(x: String): Unit = ()
10+
}
11+
12+
class C extends ST {
13+
import O._ // needs to pick inherited member because they are made visible in same scope.
14+
val x = f("abc")
15+
val y: Int = x
16+
}
17+
18+
}

0 commit comments

Comments
 (0)