We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 0cc73c6 + 0432bb0 commit dbb48c8Copy full SHA for dbb48c8
src/dotty/tools/dotc/ast/tpd.scala
@@ -707,9 +707,15 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
707
val alternatives = ctx.typer.resolveOverloaded(alts, proto, Nil)
708
assert(alternatives.size == 1) // this is parsed from bytecode tree. there's nothing user can do about it
709
710
+ val prefixTpe =
711
+ if (method eq nme.CONSTRUCTOR)
712
+ receiver.tpe.normalizedPrefix // <init> methods are part of the enclosing scope
713
+ else
714
+ receiver.tpe
715
+
716
val selected = alternatives.head
717
val fun = receiver
- .select(TermRef.withSig(receiver.tpe.normalizedPrefix, selected.termSymbol.asTerm))
718
+ .select(TermRef.withSig(prefixTpe, selected.termSymbol.asTerm))
719
.appliedToTypes(targs)
720
721
def adaptLastArg(lastParam: Tree, expectedType: Type) = {
0 commit comments