xref: /aosp_15_r20/external/ksp/test-utils/testData/api/declarationPackageName.kt (revision af87fb4bb8e3042070d2a054e912924f599b22b7)
1 /*
2  * Copyright 2020 Google LLC
3  * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 // TEST PROCESSOR: DeclarationPackageNameProcessor
19 // EXPECTED:
20 // <no name>:J1
21 // <no name>:J1.<init>
22 // <no name>:J2
23 // <no name>:J2.<init>
24 // <no name>:K1
25 // <no name>:K1.<init>
26 // <no name>:K2
27 // <no name>:K2.<init>
28 // test.java.pack:C
29 // test.java.pack:C.<init>
30 // test.java.pack:Inner
31 // test.java.pack:Inner.<init>
32 // test.java.pack:Nested
33 // test.java.pack:Nested.<init>
34 // test.pack:Inner
35 // test.pack:Inner.<init>
36 // test.pack:Inner.innerFoo
37 // test.pack:InnerLocal
38 // test.pack:InnerLocal.<init>
39 // test.pack:Nested
40 // test.pack:Nested.<init>
41 // test.pack:Nested.nestedFoo
42 // test.pack:Outer
43 // test.pack:Outer.<init>
44 // test.pack:Outer.Foo
45 // test.pack:Val
46 // test.pack:a
47 // test.pack:innerVal
48 // test.pack:nestedVal
49 // END
50 
51 // MODULE: module1
52 // FILE: K1.kt
53 class K1
54 
55 // FILE: J1.java
56 class J1 {
57 }
58 
59 // MODULE: main(module1)
60 // FILE: K2.kt
61 class K2
62 
63 // FILE: J2.java
64 class J2 {
65 }
66 
67 // FILE: a.kt
68 package test.pack
69 
70 class Outer {
71     val Val
72 
Foonull73     fun Foo() {}
74 
75     inner class Inner {
76         val innerVal: Int
innerFoonull77         fun innerFoo() {
78             class InnerLocal
79         }
80     }
81     class Nested {
82         private val nestedVal: Int
nestedFoonull83         fun nestedFoo() {
84             val a = 1
85         }
86     }
87 }
88 
89 //FILE: test/java/pack/C.java
90 package test.java.pack;
91 
92 public class C {
93     class Inner {
94 
95     }
96 
97     static class Nested  {}
98 }
99