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.
apply
1 parent cec9aa3 commit 55f07c4Copy full SHA for 55f07c4
compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -3981,7 +3981,9 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
3981
3982
/** Convert constructor proxy reference to a new expression */
3983
def newExpr =
3984
- val Select(qual, nme.apply) = tree: @unchecked
+ val qual = (tree: @unchecked) match
3985
+ case Select(qual, nme.apply) => qual
3986
+ case Ident(nme.apply) => This(tree.symbol.owner.asClass).withSpan(tree.span)
3987
val tycon = tree.tpe.widen.finalResultType.underlyingClassRef(refinementOK = false)
3988
val tpt = qual match
3989
case Ident(name) =>
tests/new/i15414.scala
@@ -0,0 +1,4 @@
1
+class C()
2
+object C {
3
+ val c = apply()
4
+}
0 commit comments