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.
1 parent f7bf2b4 commit 107d8ffCopy full SHA for 107d8ff
compiler/test/dotty/tools/dotc/printing/PrinterTests.scala
@@ -0,0 +1,27 @@
1
+package dotty.tools.dotc.printing
2
+
3
+import dotty.tools.DottyTest
4
+import dotty.tools.dotc.ast.tpd
5
+import dotty.tools.dotc.core.Names._
6
+import dotty.tools.dotc.core.Symbols._
7
+import org.junit.Assert.assertEquals
8
+import org.junit.Test
9
10
+class PrinterTests extends DottyTest {
11
+ import tpd._
12
13
+ @Test
14
+ def packageObject: Unit = {
15
+ val source = """
16
+ package object foo {
17
+ def bar: Int = 1
18
+ }
19
+ """
20
21
+ checkCompile("frontend", source) { (tree, context) =>
22
+ implicit val ctx = context
23
+ val bar = tree.find(tree => tree.symbol.name == termName("bar")).get
24
+ assertEquals("package object foo", bar.symbol.owner.show)
25
26
27
+}
0 commit comments