Skip to content

Commit 2b1661a

Browse files
committed
Revert "XXX Confirm we actually found a member with right name."
This reverts commit 69bafc2. As I feared, traversing outer methods will never find one matching cycleSym in recursive methods.
1 parent 87f885b commit 2b1661a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ class CyclicReference private (val denot: SymDenotation, var inImplicitSearch: B
110110
def errorMsg(cx: Context): Message = {
111111
if (cx.mode is Mode.InferringReturnType) {
112112
cx.tree match {
113-
case tree: untpd.ValOrDefDef if inImplicitSearch && !tree.tpt.typeOpt.exists && tree.name == cycleSym.name =>
113+
case tree: untpd.ValOrDefDef if inImplicitSearch && !tree.tpt.typeOpt.exists =>
114114
// Can happen in implicit defs (#4709) or outside (#3253).
115115
TermMemberNeedsNeedsResultTypeForImplicitSearch(cycleSym)
116-
case tree: untpd.DefDef if !tree.tpt.typeOpt.exists && tree.name == cycleSym.name =>
116+
case tree: untpd.DefDef if !tree.tpt.typeOpt.exists =>
117117
OverloadedOrRecursiveMethodNeedsResultType(tree.name)
118-
case tree: untpd.ValDef if !tree.tpt.typeOpt.exists && tree.name == cycleSym.name =>
118+
case tree: untpd.ValDef if !tree.tpt.typeOpt.exists =>
119119
RecursiveValueNeedsResultType(tree.name)
120120
case _ =>
121121
errorMsg(cx.outer)

0 commit comments

Comments
 (0)