We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7775aab commit ba48e7fCopy full SHA for ba48e7f
compiler/src/dotty/tools/dotc/typer/Typer.scala
@@ -357,6 +357,9 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
357
}
358
359
val tree1 = ownType match {
360
+ case ownType: NamedType if ownType.symbol.is(Package) && !pt.isInstanceOf[SelectionProto] =>
361
+ val pkgObj = ownType.symbol.moduleClass.denot.asInstanceOf[PackageClassDenotation].packageObj
362
+ if (pkgObj.exists) ref(pkgObj.valRef) else tree.withType(ownType)
363
case ownType: NamedType if !prefixIsElidable(ownType) =>
364
ref(ownType).withPos(tree.pos)
365
case _ =>
tests/pos/i1786.scala
@@ -0,0 +1,11 @@
1
+package object meta {
2
+ def apply(x: Int): Int = x * x
3
+}
4
+
5
+class Test {
6
+ def f = meta {
7
+ 5 + 4
8
+ }
9
10
+ meta
11
0 commit comments