File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -357,6 +357,9 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
357
357
}
358
358
359
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)
360
363
case ownType : NamedType if ! prefixIsElidable(ownType) =>
361
364
ref(ownType).withPos(tree.pos)
362
365
case _ =>
Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments