Skip to content

Commit 0cecb11

Browse files
committed
Implemented suggest change
1 parent a901b25 commit 0cecb11

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

compiler/src/dotty/tools/dotc/transform/init/Objects.scala

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,13 +1573,7 @@ class Objects(using Context @constructorOnly):
15731573
val target = expr.tpe.widenSingleton.classSymbol.asClass
15741574
withTrace(trace2) { resolveThis(target, qual.asInstanceOf[ThisValue], klass) }
15751575
case _ =>
1576-
qual match {
1577-
// Check if expression is a selection of a method
1578-
case v: SafeValue if expr.symbol.is(Flags.Method) =>
1579-
withTrace(trace2) { call(v, expr.symbol, args = Nil, receiver = qualifier.tpe, superType = NoType) }
1580-
case _ =>
1581-
withTrace(trace2) { select(qual, expr.symbol, receiver = qualifier.tpe) }
1582-
}
1576+
withTrace(trace2) { select(qual, expr.symbol, receiver = qualifier.tpe) }
15831577

15841578
case _: This =>
15851579
evalType(expr.tpe, thisV, klass)

compiler/src/dotty/tools/dotc/transform/init/Util.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ object Util:
5959
case TypeApply(fn, targs) =>
6060
unapply(fn)
6161

62-
case ref: RefTree if ref.tpe.widenSingleton.isInstanceOf[MethodicType] =>
62+
case ref: RefTree if ref.symbol.is(Flags.Method) =>
6363
Some((ref, Nil))
6464

6565
case _ => None

0 commit comments

Comments
 (0)