/* * Copyright 2023 Google LLC * Copyright 2010-2023 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: B.java: null // parent of ITF: ITF // parent of ITF: B // parent of Any: (Any..Any?) // parent of (Any..Any?): T // parent of T: B // parent of Anno: Anno // parent of Anno: @Anno // parent of param:: @Anno // parent of @Anno: B // parent of Bnno: Bnno // parent of Bnno: @Bnno // parent of @Bnno: B // parent of B: File: B.java // parent of T: (T..T?) // parent of (T..T?): t // parent of t: B // parent of T: (T..T?) // parent of (T..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 Any: (Any..Any?) // parent of (Any..Any?): T // parent of T: B // parent of synthetic constructor for B: B // parent of RGB: (RGB..RGB?) // parent of (RGB..RGB?): INVARIANT (RGB..RGB?) // parent of INVARIANT (RGB..RGB?): Enum // parent of Enum: Enum<(RGB..RGB?)> // parent of Enum<(RGB..RGB?)>: RGB // parent of RGB: File: B.java // parent of RGB.R: RGB // parent of RGB.G: RGB // parent of RGB.B: RGB // parent of Array: values // parent of values: RGB // parent of String: value // parent of value: valueOf // parent of RGB: valueOf // parent of valueOf: RGB // parent of EnumEntries: entries // parent of entries: RGB // parent of File: Bnno.kt: null // parent of Annotation: Annotation // parent of Annotation: Bnno // parent of Bnno: File: Bnno.kt // parent of Bnno: synthetic constructor for Bnno // parent of synthetic constructor for Bnno: Bnno // parent of File: a.kt: null // parent of Int: Int // parent of Int: INVARIANT Int // parent of INVARIANT Int: List // parent of List: List // parent of List: topProp // parent of List: List // parent of List: 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 Annotation: Annotation // parent of Annotation: Anno // parent of Anno: File: a.kt // parent of String: String // parent of String: param // parent of String: param.getter() // parent of param.getter(): param // parent of param: Anno // parent of String: String // parent of String: param // parent of param: // parent of Anno: Anno // parent of Anno: // parent of : 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: File: a.kt // parent of Alias: 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: Int // parent of Int: memberFun // parent of memberFun: topClass // 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 String: String // parent of String: b.getter() // parent of b.getter(): b // parent of String: value // parent of value: 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: 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: Int // parent of Int: innerFun // parent of innerFun: InnerClass // parent of InnerClass<*>: synthetic constructor for InnerClass // parent of Any?: P // parent of synthetic constructor for InnerClass: InnerClass // parent of CMYK: CMYK // parent of CMYK: INVARIANT CMYK // parent of INVARIANT CMYK: Enum // parent of Enum: Enum // parent of Enum: CMYK // parent of CMYK: File: a.kt // parent of CMYK: synthetic constructor for CMYK // parent of synthetic constructor for CMYK: CMYK // parent of CMYK.C: CMYK // parent of CMYK.M: CMYK // parent of CMYK.Y: CMYK // parent of CMYK.K: CMYK // parent of Array: values // parent of values: CMYK // parent of String: value // parent of value: valueOf // parent of CMYK: valueOf // parent of valueOf: CMYK // parent of EnumEntries: entries // parent of EnumEntries: entries.getter() // parent of entries.getter(): entries // parent of entries: CMYK // parent of YUV: YUV // parent of YUV: INVARIANT YUV // parent of INVARIANT YUV: Enum // parent of Enum: Enum // parent of Enum: YUV // parent of YUV: null // parent of YUV: YUV // parent of YUV: // parent of : YUV // parent of YUV.Y: YUV // parent of YUV.U: YUV // parent of YUV.V: YUV // parent of YUV: YUV // parent of YUV: INVARIANT YUV // parent of INVARIANT YUV: Array // parent of Array: Array // parent of Array: values // parent of values: 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: EnumEntries // parent of EnumEntries: EnumEntries // parent of EnumEntries: entries // parent of YUV: YUV // parent of YUV: INVARIANT YUV // parent of INVARIANT YUV: EnumEntries // parent of EnumEntries: EnumEntries // parent of EnumEntries: entries.getter() // parent of entries.getter(): entries // parent of entries: YUV // parent of HSV: (HSV..HSV?) // parent of (HSV..HSV?): INVARIANT (HSV..HSV?) // parent of INVARIANT (HSV..HSV?): Enum // parent of Enum: Enum<(HSV..HSV?)> // parent of Enum<(HSV..HSV?)>: HSV // parent of HSV: File: HSV.class // parent of HSV: HSV // parent of HSV: // parent of : HSV // parent of HSV.H: HSV // parent of HSV.S: HSV // parent of HSV.V: HSV // parent of Array: values // parent of values: HSV // parent of String: value // parent of value: valueOf // parent of HSV: valueOf // parent of valueOf: HSV // parent of HSV: HSV // parent of HSV: INVARIANT HSV // parent of INVARIANT HSV: EnumEntries // parent of EnumEntries: EnumEntries // parent of EnumEntries: entries // parent of entries: 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(val param: String = "") typealias Alias = Map @Anno val topProp : List? = null @Anno fun topFun() : T? { return null } interface ITF @Anno class topClass: ITF { fun memberFun(i: Int) = 1 class InnerClass

{ 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 implements ITF { private T t; public int foo(T t, int i) { return 1; } } enum RGB { R, G, B }