Skip to content

Commit fe6b1b4

Browse files
dwijnandWojciechMazur
authored andcommitted
Use Symbol not name!!
[Cherry-picked 2a02773]
1 parent 7fa5efd commit fe6b1b4

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

compiler/src/dotty/tools/dotc/core/Symbols.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ object Symbols extends SymUtils {
319319
case cls: ClassSymbol => cls.rootTreeContaining(name.toString)
320320
case _ => EmptyTree
321321
val targets = root.collectSubTrees:
322-
case tree: DefDef if tree.name == name => methPart(tree.rhs).tpe
322+
case tree: DefDef if tree.symbol == denot.symbol => methPart(tree.rhs).tpe
323323
targets.match
324324
case (tp: NamedType) :: _ => tp.symbol.sourceSymbol
325325
case _ => this

presentation-compiler/test/dotty/tools/pc/tests/definition/PcDefinitionSuite.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,17 @@ class PcDefinitionSuite extends BasePcDefinitionSuite:
263263
|""".stripMargin
264264
)
265265

266+
@Test def exportTerm1Overload =
267+
check(
268+
"""trait Foo:
269+
| def <<meth>>(x: Int): Int
270+
| def meth(x: String): String
271+
|class Bar(val foo: Foo):
272+
| export foo.*
273+
| def test(bar: Bar) = bar.me@@th(0)
274+
|""".stripMargin
275+
)
276+
266277
@Test def `named-arg-local` =
267278
check(
268279
"""|

0 commit comments

Comments
 (0)