aboutsummaryrefslogtreecommitdiff
path: root/test-utils/testData/api/parent.kt
blob: 5237289b6731e1999ae3b9cc2b28aaff189a0465 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
/*
 * Copyright 2022 Google LLC
 * Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// TEST PROCESSOR: ParentProcessor
// EXPECTED:
// parent of File: a.kt: null
// parent of Any: Anno
// parent of Anno: File: a.kt
// parent of Anno: synthetic constructor for Anno
// parent of synthetic constructor for Anno: Anno
// parent of Int: Int
// parent of Int: INVARIANT Int
// parent of INVARIANT Int: Map
// parent of T: T
// parent of T: INVARIANT T
// parent of INVARIANT T: Map
// parent of Map: Map
// parent of Map: Alias
// parent of Any?: T
// parent of T: Alias
// parent of Alias: File: a.kt
// parent of Int: Int
// parent of Int: INVARIANT Int
// parent of INVARIANT Int: List
// parent of List: List
// parent of List: topProp
// parent of Int: Int
// parent of Int: INVARIANT Int
// parent of INVARIANT Int: List<Int>
// parent of List<Int>: List<Int>
// parent of List<Int>: topProp.getter()
// parent of topProp.getter(): topProp
// parent of Anno: Anno
// parent of Anno: @Anno
// parent of @Anno: topProp
// parent of topProp: File: a.kt
// parent of T: T
// parent of T: topFun
// parent of Any?: T
// parent of T: topFun
// parent of Anno: Anno
// parent of Anno: @Anno
// parent of @Anno: topFun
// parent of topFun: File: a.kt
// parent of Any: ITF
// parent of ITF: File: a.kt
// parent of ITF: ITF
// parent of ITF: topClass
// parent of Anno: Anno
// parent of Anno: @Anno
// parent of @Anno: topClass
// parent of topClass: File: a.kt
// parent of Int: Int
// parent of Int: i
// parent of i: memberFun
// parent of Int: memberFun
// parent of memberFun: topClass
// parent of Any: InnerClass
// parent of Any?: P
// parent of P: InnerClass
// parent of InnerClass: topClass
// parent of P: P
// parent of P: p
// parent of p: innerFun
// parent of Int: innerFun
// parent of innerFun: InnerClass
// parent of InnerClass<*>: synthetic constructor for InnerClass
// parent of synthetic constructor for InnerClass: InnerClass
// parent of Int: Int
// parent of Int: a
// parent of Int: Int
// parent of Int: a.getter()
// parent of a.getter(): a
// parent of a: topClass
// parent of String: String
// parent of String: b
// parent of b.getter(): b
// parent of String: String
// parent of String: <set-?>
// parent of <set-?>: b.setter()
// parent of b.setter(): b
// parent of b: topClass
// parent of topClass: synthetic constructor for topClass
// parent of synthetic constructor for topClass: topClass
// parent of Any: CMYK
// parent of CMYK: File: a.kt
// parent of Any: C
// parent of C: CMYK
// parent of C: synthetic constructor for C
// parent of synthetic constructor for C: C
// parent of Any: M
// parent of M: CMYK
// parent of M: synthetic constructor for M
// parent of synthetic constructor for M: M
// parent of Any: Y
// parent of Y: CMYK
// parent of Y: synthetic constructor for Y
// parent of synthetic constructor for Y: Y
// parent of Any: K
// parent of K: CMYK
// parent of K: synthetic constructor for K
// parent of synthetic constructor for K: K
// parent of CMYK: synthetic constructor for CMYK
// parent of synthetic constructor for CMYK: CMYK
// parent of File: Bnno.kt: null
// parent of Any: Bnno
// parent of Bnno: File: Bnno.kt
// parent of Bnno: synthetic constructor for Bnno
// parent of synthetic constructor for Bnno: Bnno
// parent of File: B.java: null
// parent of ITF: ITF
// parent of ITF: B
// parent of T: B
// parent of Anno: Anno
// parent of Anno: @Anno
// parent of @Anno: B
// parent of p: Bnno
// parent of p.Bnno: Bnno
// parent of Bnno: @Bnno
// parent of @Bnno: B
// parent of B: File: B.java
// parent of T: T
// parent of T: t
// parent of t: B
// parent of T: T
// parent of T: t
// parent of t: foo
// parent of Int: Int
// parent of Int: i
// parent of i: foo
// parent of Int: Int
// parent of Int: foo
// parent of foo: B
// parent of B<*>: synthetic constructor for B
// parent of synthetic constructor for B: B
// parent of RGB: RGB
// parent of RGB: INVARIANT RGB
// parent of INVARIANT RGB: Enum<RGB>
// parent of Enum<RGB>: Enum<RGB>
// parent of Enum<RGB>: RGB
// parent of RGB: File: B.java
// parent of R: RGB
// parent of G: RGB
// parent of B: RGB
// parent of RGB: RGB
// parent of RGB: INVARIANT RGB
// parent of INVARIANT RGB: Array<(RGB..RGB?)>
// parent of Array<(RGB..RGB?)>: Array<(RGB..RGB?)>
// parent of Array<(RGB..RGB?)>: values
// parent of values: RGB
// parent of java: String
// parent of lang: String
// parent of String: String
// parent of String: name
// parent of name: valueOf
// parent of RGB: RGB
// parent of RGB: valueOf
// parent of valueOf: RGB
// parent of RGB: synthetic constructor for RGB
// parent of synthetic constructor for RGB: RGB
// parent of YUV: YUV
// parent of YUV: INVARIANT YUV
// parent of INVARIANT YUV: Enum<YUV>
// parent of Enum<YUV>: Enum<YUV>
// parent of Enum<YUV>: YUV
// parent of YUV: null
// parent of YUV: YUV
// parent of YUV: Y
// parent of Y: YUV
// parent of YUV: YUV
// parent of YUV: U
// parent of U: YUV
// parent of YUV: YUV
// parent of YUV: V
// parent of V: YUV
// parent of String: String
// parent of String: value
// parent of value: valueOf
// parent of YUV: YUV
// parent of YUV: valueOf
// parent of valueOf: YUV
// parent of YUV: YUV
// parent of YUV: INVARIANT YUV
// parent of INVARIANT YUV: Array<YUV>
// parent of Array<YUV>: Array<YUV>
// parent of Array<YUV>: values
// parent of values: YUV
// parent of YUV: YUV
// parent of YUV: <init>
// parent of <init>: YUV
// parent of HSV: HSV
// parent of HSV: INVARIANT HSV
// parent of INVARIANT HSV: Enum<(HSV..HSV?)>
// parent of Enum<(HSV..HSV?)>: Enum<(HSV..HSV?)>
// parent of Enum<(HSV..HSV?)>: HSV
// parent of HSV: null
// parent of HSV: HSV
// parent of HSV: H
// parent of H: HSV
// parent of HSV: HSV
// parent of HSV: S
// parent of S: HSV
// parent of HSV: HSV
// parent of HSV: V
// parent of V: HSV
// parent of String: String
// parent of String: value
// parent of value: valueOf
// parent of HSV: HSV
// parent of HSV: valueOf
// parent of valueOf: HSV
// parent of HSV: HSV
// parent of HSV: INVARIANT HSV
// parent of INVARIANT HSV: Array<HSV>
// parent of Array<HSV>: Array<HSV>
// parent of Array<HSV>: values
// parent of values: HSV
// parent of HSV: HSV
// parent of HSV: <init>
// parent of <init>: HSV
// END

// MODULE: lib
// FILE: YUV.kt
enum class YUV {
    Y, U, V
}

// FILE: HSV.java
enum HSV {
    H, S, V
}

// MODULE: main(lib)

// FILE: a.kt
annotation class Anno

typealias Alias<T> = Map<Int, T>

@Anno
val topProp : List<Int>? = null

@Anno
fun <T> topFun() : T? {
    return null
}

interface ITF

@Anno
class topClass: ITF {
    fun memberFun(i: Int) = 1
    class InnerClass<P> {
        fun innerFun(p: P) = 1
    }

    val a: Int = 1
    var b: String
    get() = "1"
}

enum class CMYK {
    C, M, Y, K
}

// FILE: Bnno.kt
package p

annotation class Bnno

// FILE: B.java
@Anno
@p.Bnno
public class B<T> implements ITF {
    private T t;
    public int foo(T t, int i) {
        return 1;
    }
}

enum RGB {
    R, G, B
}