File tree 3 files changed +13
-3
lines changed
compiler/src/dotty/tools/dotc/typer
3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ trait ImportSuggestions:
57
57
* skipped as an optimization, since they won't contain implicits anyway.
58
58
*/
59
59
private def suggestionRoots (using Context ) =
60
- val seen = mutable.Set [TermRef ]()
60
+ val seen = mutable.Set [Symbol ]()
61
61
62
62
def lookInside (root : Symbol )(using Context ): Boolean =
63
63
explore {
@@ -103,10 +103,10 @@ trait ImportSuggestions:
103
103
.toList
104
104
105
105
def rootsIn (ref : TermRef )(using Context ): List [TermRef ] =
106
- if seen.contains(ref) then Nil
106
+ if seen.contains(ref.termSymbol ) then Nil
107
107
else
108
108
implicitsDetailed.println(i " search for suggestions in ${ref.symbol.fullName}" )
109
- seen += ref
109
+ seen += ref.termSymbol
110
110
ref :: rootsStrictlyIn(ref)
111
111
112
112
def rootsOnPath (tp : Type )(using Context ): List [TermRef ] = tp match
Original file line number Diff line number Diff line change
1
+ -- [E008] Not Found Error: tests/neg/22145c.scala:2:35 -----------------------------------------------------------------
2
+ 2 | def bar(base: Collection) = base.foo // error
3
+ | ^^^^^^^^
4
+ | value foo is not a member of Collection
Original file line number Diff line number Diff line change
1
+ trait Collection :
2
+ def bar (base : Collection ) = base.foo // error
3
+ object a extends Collection :
4
+ def foo : Int = 0
5
+ object b extends Collection :
6
+ def foo : Int = 1
You can’t perform that action at this time.
0 commit comments