File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -138,8 +138,7 @@ class Typer extends Namer with Applications with Implicits {
138
138
}
139
139
val where = if (ctx.owner.exists) s " from ${ctx.owner.enclosingClass}" else " "
140
140
val whyNot = new StringBuffer
141
- val addendum =
142
- alts foreach (_.isAccessibleFrom(pre, superAccess, whyNot))
141
+ alts foreach (_.isAccessibleFrom(pre, superAccess, whyNot))
143
142
if (! tpe.isError)
144
143
ctx.error(i " $what cannot be accessed as a member of $pre$where. $whyNot" , pos)
145
144
ErrorType
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments