Stub generation infrastructure (except for metadata generation) for KAPT+K2

This commit includes the basic Java stubs generation infrastructure and
the corresponding tests. The main entry point is called
Kapt4StubGenerator. Calls to it from production code will be added in a
separate commit.

 #KT-51982
This commit is contained in:
Pavel Mikhailovskii
2023-07-20 21:58:23 +02:00
committed by Space Team
parent ae4fab8483
commit 2002542ad2
113 changed files with 8249 additions and 34 deletions
@@ -0,0 +1,120 @@
@kotlin.Metadata()
public enum E {
/*public static final*/ X /* = new E() */,
/*public static final*/ Y /* = new E() */;
E() {
}
public abstract void a();
public final void b() {
}
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<E> getEntries() {
return null;
}
@kotlin.Metadata()
public static final class Obj {
@org.jetbrains.annotations.NotNull()
public static final E.Obj INSTANCE = null;
private Obj() {
super();
}
}
@kotlin.Metadata()
public static final class NestedClass {
public NestedClass() {
super();
}
}
}
////////////////////
@kotlin.Metadata()
public enum E2 {
/*public static final*/ X /* = new E2() */,
/*public static final*/ Y /* = new E2() */;
E2(int n) {
}
E2(java.lang.String s) {
}
public abstract void a();
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<E2> getEntries() {
return null;
}
}
////////////////////
@kotlin.Metadata()
public enum E3 {
/*public static final*/ X /* = new E3() */,
/*public static final*/ Y /* = new E3() */;
@org.jetbrains.annotations.NotNull()
private final java.lang.String a = null;
E3(java.lang.String a) {
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getA() {
return null;
}
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<E3> getEntries() {
return null;
}
}
////////////////////
@kotlin.Metadata()
public enum E4 {
/*public static final*/ X /* = new E4() */;
@org.jetbrains.annotations.NotNull()
private final java.lang.String a = null;
private final int b = 0;
private final long c = 0L;
private final boolean d = false;
E4(java.lang.String a, int b, long c, boolean d) {
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getA() {
return null;
}
public final int getB() {
return 0;
}
public final long getC() {
return 0L;
}
public final boolean getD() {
return false;
}
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<E4> getEntries() {
return null;
}
}
@@ -0,0 +1,88 @@
import a.b.ABC;
@kotlin.Metadata()
public final class Test {
public Test.MyDate date;
public java.util.concurrent.TimeUnit timeUnit;
public a.b.ABC abc;
public bcd bcd;
public Test() {
super();
}
@org.jetbrains.annotations.NotNull()
public final Test.MyDate getDate() {
return null;
}
public final void setDate(@org.jetbrains.annotations.NotNull()
Test.MyDate p0) {
}
@org.jetbrains.annotations.NotNull()
public final java.util.concurrent.TimeUnit getTimeUnit() {
return null;
}
public final void setTimeUnit(@org.jetbrains.annotations.NotNull()
java.util.concurrent.TimeUnit p0) {
}
@org.jetbrains.annotations.NotNull()
public final a.b.ABC getAbc() {
return null;
}
public final void setAbc(@org.jetbrains.annotations.NotNull()
a.b.ABC p0) {
}
@org.jetbrains.annotations.NotNull()
public final bcd getBcd() {
return null;
}
public final void setBcd(@org.jetbrains.annotations.NotNull()
bcd p0) {
}
@kotlin.Metadata()
public static final class MyDate {
public Test.MyDate date2;
public MyDate() {
super();
}
@org.jetbrains.annotations.NotNull()
public final Test.MyDate getDate2() {
return null;
}
public final void setDate2(@org.jetbrains.annotations.NotNull()
Test.MyDate p0) {
}
}
}
////////////////////
@kotlin.Metadata()
public final class Test2 {
public java.util.Date date;
public Test2() {
super();
}
@org.jetbrains.annotations.NotNull()
public final java.util.Date getDate() {
return null;
}
public final void setDate(@org.jetbrains.annotations.NotNull()
java.util.Date p0) {
}
}
@@ -1,8 +1,7 @@
// IGNORE_BACKEND: JVM_IR
// CORRECT_ERROR_TYPES
// NO_VALIDATION
@file:Suppress("ENUM_ENTRY_AS_TYPE", "UNRESOLVED_REFERENCE")
@file:Suppress("UNRESOLVED_REFERENCE")
import java.util.Date as MyDate
import java.util.concurrent.TimeUnit as MyTimeUnit
import java.util.concurrent.TimeUnit.*
@@ -14,7 +13,6 @@ import bcd as MyBCD
class Test {
lateinit var date: MyDate
lateinit var timeUnit: MyTimeUnit
lateinit var microseconds: MyMicroseconds
lateinit var abc: MyABC
lateinit var bcd: MyBCD
@@ -6,7 +6,6 @@ import a.b.ABC;
public final class Test {
public Test.MyDate date;
public java.util.concurrent.TimeUnit timeUnit;
public java.util.concurrent.TimeUnit microseconds;
public a.b.ABC abc;
public bcd bcd;
@@ -32,15 +31,6 @@ public final class Test {
java.util.concurrent.TimeUnit p0) {
}
@org.jetbrains.annotations.NotNull()
public final java.util.concurrent.TimeUnit getMicroseconds() {
return null;
}
public final void setMicroseconds(@org.jetbrains.annotations.NotNull()
java.util.concurrent.TimeUnit p0) {
}
@org.jetbrains.annotations.NotNull()
public final a.b.ABC getAbc() {
return null;
@@ -0,0 +1,61 @@
package lib;
public @interface Anno {
Class<?>[] impls() default {};
}
////////////////////
package lib.impl;
public class Impl {
}
////////////////////
package test;
@kotlin.Metadata()
@lib.Anno(impls = {lib.impl.Impl.class, ABC.class})
public final class Bar {
public Bar() {
super();
}
}
////////////////////
package test;
@kotlin.Metadata()
@lib.Anno(impls = {lib.impl.Impl.class})
public final class Boo {
public Boo() {
super();
}
}
////////////////////
package test;
@kotlin.Metadata()
@lib.Anno(impls = {lib.impl.Impl.class})
public final class Foo {
public Foo() {
super();
}
}
////////////////////
package test;
@kotlin.Metadata()
@kotlin.Suppress(names = {"UNRESOLVED_REFERENCE", "ANNOTATION_ARGUMENT_MUST_BE_CONST", "NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION"})
public final class TestKt {
}
@@ -0,0 +1,128 @@
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface Anno1 {
}
////////////////////
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface Anno2 {
public abstract int i() default 5;
public abstract java.lang.String s() default "ABC";
public abstract int[] ii() default {1, 2, 3};
public abstract java.lang.String[] ss() default {"A", "B"};
public abstract Anno1 a();
public abstract Colors color() default Colors.BLACK;
public abstract Colors[] colors() default {Colors.BLACK, Colors.WHITE};
public abstract java.lang.Class<?> clazz();
public abstract java.lang.Class<?>[] classes();
}
////////////////////
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface Anno3 {
public abstract java.lang.String value();
}
////////////////////
@kotlin.Metadata()
public enum Colors {
/*public static final*/ WHITE /* = new Colors() */,
/*public static final*/ BLACK /* = new Colors() */;
Colors() {
}
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<Colors> getEntries() {
return null;
}
}
////////////////////
@kotlin.Metadata()
public enum Enum1 {
/*public static final*/ BLACK /* = new Enum1() */,
@Anno1()
/*public static final*/ WHITE /* = new Enum1() */;
Enum1() {
}
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<Enum1> getEntries() {
return null;
}
}
////////////////////
@kotlin.Metadata()
@Anno1()
@Anno2(a = @Anno1(), clazz = TestAnno.class, classes = {TestAnno.class, Anno1.class})
@Anno3(value = "value")
public final class TestAnno {
public TestAnno() {
super();
}
}
////////////////////
@kotlin.Metadata()
@Anno3(value = "value")
@Anno2(i = 6, s = "BCD", ii = {4, 5, 6}, ss = {"Z", "X"}, a = @Anno1(), color = Colors.WHITE, colors = {Colors.WHITE}, clazz = TestAnno.class, classes = {TestAnno.class, Anno1.class})
public final class TestAnno2 {
@Anno3(value = "field")
@org.jetbrains.annotations.NotNull()
private java.lang.String b = "property initializer";
public TestAnno2() {
super();
}
@Anno1()
public final void a(@Anno3(value = "param-pam-pam")
@org.jetbrains.annotations.NotNull()
java.lang.String param) {
}
@Anno3(value = "getter")
@org.jetbrains.annotations.NotNull()
public final java.lang.String getB() {
return null;
}
@Anno3(value = "property")
@java.lang.Deprecated()
public static void getB$annotations() {
}
@Anno3(value = "setter")
public final void setB(@Anno3(value = "setparam")
@org.jetbrains.annotations.NotNull()
java.lang.String p0) {
}
}
@@ -0,0 +1,114 @@
package test;
@kotlin.Metadata()
@Anno(value = "anno-class")
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface Anno {
public abstract java.lang.String value();
}
////////////////////
package test;
@kotlin.Metadata()
@kotlin.jvm.JvmName(name = "AnnotationsTest")
public final class AnnotationsTest {
public AnnotationsTest() {
super();
}
@org.jetbrains.annotations.NotNull()
public static final java.lang.String getTopLevelVal(@Anno(value = "top-level-val-receiver")
int $this$topLevelVal) {
return null;
}
@Anno(value = "top-level-val")
@java.lang.Deprecated()
public static void getTopLevelVal$annotations(int p0) {
}
@Anno(value = "top-level-fun")
public static final void topLevelFun(@Anno(value = "top-level-fun-receiver")
@org.jetbrains.annotations.NotNull()
java.lang.String $this$topLevelFun) {
}
}
////////////////////
package test;
@kotlin.Metadata()
@Anno(value = "enum")
public enum Enum {
@Anno(value = "white")
/*public static final*/ WHITE /* = new Enum() */,
@Anno(value = "black")
/*public static final*/ BLACK /* = new Enum() */;
private final int x = 0;
@Anno(value = "enum-constructor")
Enum(@Anno(value = "x")
int x) {
}
public final int getX() {
return 0;
}
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<test.Enum> getEntries() {
return null;
}
}
////////////////////
package test;
@kotlin.Metadata()
@Anno(value = "clazz")
public abstract class Test {
@org.jetbrains.annotations.NotNull()
private java.lang.String v;
@Anno(value = "test-constructor")
protected Test(@Anno(value = "v-param")
@org.jetbrains.annotations.NotNull()
java.lang.String v) {
super();
}
@Anno(value = "v-get")
@org.jetbrains.annotations.NotNull()
public final java.lang.String getV() {
return null;
}
@Anno(value = "v-property")
@java.lang.Deprecated()
public static void getV$annotations() {
}
@Anno(value = "v-set")
public final void setV(@Anno(value = "v-setparam")
@org.jetbrains.annotations.NotNull()
java.lang.String p0) {
}
@Anno(value = "abstract-method")
@org.jetbrains.annotations.NotNull()
public abstract java.lang.String abstractMethod();
@org.jetbrains.annotations.NotNull()
public abstract java.lang.String getAbstractVal();
@Anno(value = "abstract-val")
@java.lang.Deprecated()
public static void getAbstractVal$annotations() {
}
}
@@ -0,0 +1,88 @@
@kotlin.Metadata()
public final class B {
public B() {
super();
}
}
////////////////////
@kotlin.Metadata()
public final class BParceler implements Parceler<B> {
@org.jetbrains.annotations.NotNull()
public static final BParceler INSTANCE = null;
private BParceler() {
super();
}
}
////////////////////
@kotlin.Metadata()
public final class C {
public C() {
super();
}
}
////////////////////
@kotlin.Metadata()
public final class CParceler implements Parceler<C> {
@org.jetbrains.annotations.NotNull()
public static final CParceler INSTANCE = null;
private CParceler() {
super();
}
}
////////////////////
@kotlin.Metadata()
public abstract interface Parceler<T extends java.lang.Object> {
}
////////////////////
@kotlin.Metadata()
@TypeParceler()
@TypeParceler()
public final class Test {
public Test() {
super();
}
}
////////////////////
@kotlin.Metadata()
@kotlin.annotation.Retention(value = kotlin.annotation.AnnotationRetention.SOURCE)
@kotlin.annotation.Repeatable()
@kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.CLASS, kotlin.annotation.AnnotationTarget.PROPERTY})
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.SOURCE)
@java.lang.annotation.Repeatable(value = TypeParceler.Container.class)
@java.lang.annotation.Target(value = {java.lang.annotation.ElementType.TYPE})
public abstract @interface TypeParceler<T extends java.lang.Object, P extends Parceler<? super T>> {
@kotlin.Metadata()
@kotlin.annotation.Retention(value = kotlin.annotation.AnnotationRetention.SOURCE)
@kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.CLASS, kotlin.annotation.AnnotationTarget.PROPERTY})
@kotlin.jvm.internal.RepeatableContainer()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.SOURCE)
@java.lang.annotation.Target(value = {java.lang.annotation.ElementType.TYPE})
public static abstract @interface Container {
public abstract TypeParceler[] value();
}
}
@@ -0,0 +1,367 @@
package app;
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface Anno {
public abstract boolean a1();
public abstract byte a2();
public abstract int a3();
public abstract short a4();
public abstract long a5();
public abstract char a6();
public abstract float a7();
public abstract double a8();
public abstract java.lang.String a9();
}
////////////////////
package app;
public class B {
public B() {
super();
}
public static class id {
public id() {
super();
}
public static final int textView = 200;
}
public static final boolean a1 = false;
public static final byte a2 = 1;
public static final int a3 = 2;
public static final short a4 = 3;
public static final long a5 = 4L;
public static final char a6 = '5';
public static final float a7 = 6.0F;
public static final double a8 = 7.0;
public static final String a9 = "A";
}
////////////////////
package app;
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface Bind {
public abstract int id();
}
////////////////////
package app;
@kotlin.Metadata()
@kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.FIELD})
@java.lang.annotation.Target(value = {java.lang.annotation.ElementType.FIELD})
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface BindField {
public abstract int id();
}
////////////////////
package app;
@kotlin.Metadata()
public final class JJ {
@org.jetbrains.annotations.NotNull()
public static final app.JJ INSTANCE = null;
@org.jetbrains.annotations.NotNull()
private static final java.lang.String b = null;
private JJ() {
super();
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getB() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String c() {
return null;
}
}
////////////////////
package app;
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface MultiValue {
public abstract int[] ids();
}
////////////////////
package app;
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface MultiValueByte {
public abstract byte[] ids();
}
////////////////////
package app;
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface MultiValueString {
public abstract java.lang.String[] ids();
}
////////////////////
package app;
@kotlin.Metadata()
public final class MyActivity {
@BindField(id = 100)
private final int a = 0;
@BindField(id = 100)
private final int b = 0;
@BindField(id = 100)
private final int c = 0;
@BindField(id = 100)
private final int d = 0;
@BindField(id = 100)
private final int e = 0;
@BindField(id = 200)
private final int f = 0;
public final int propA = 200;
private final int propB = 200;
private int propC = 200;
@kotlin.jvm.JvmField()
public final int propD = 200;
@kotlin.jvm.JvmField()
public int propE = 200;
private final int propF = 0;
public MyActivity() {
super();
}
public final int getA() {
return 0;
}
@Bind(id = 100)
@java.lang.Deprecated()
public static void getA$annotations() {
}
public final int getB() {
return 0;
}
@Bind(id = 100)
@java.lang.Deprecated()
public static void getB$annotations() {
}
public final int getC() {
return 0;
}
@Bind(id = 100)
@java.lang.Deprecated()
public static void getC$annotations() {
}
public final int getD() {
return 0;
}
@Bind(id = 100)
@java.lang.Deprecated()
public static void getD$annotations() {
}
public final int getE() {
return 0;
}
@Bind(id = 100)
@Anno(a1 = false, a2 = 1, a3 = 2, a4 = 3, a5 = 4L, a6 = '5', a7 = 6.0F, a8 = 7.0, a9 = "A")
@java.lang.Deprecated()
public static void getE$annotations() {
}
public final int getF() {
return 0;
}
@Bind(id = 200)
@java.lang.Deprecated()
public static void getF$annotations() {
}
@Bind(id = 100)
public final void foo() {
}
@Bind(id = 100)
public final void foo2() {
}
@Bind(id = 100)
public final void foo3() {
}
@Bind(id = 100)
public final void foo4() {
}
@Bind(id = 100)
@Anno(a1 = false, a2 = 1, a3 = 2, a4 = 3, a5 = 4L, a6 = '5', a7 = 6.0F, a8 = 7.0, a9 = "A")
public final void foo5() {
}
@Bind(id = 200)
public final void plainIntConstant() {
}
@MultiValue(ids = {})
public final void multi0() {
}
@MultiValue(ids = {200})
public final void multi1() {
}
@MultiValue(ids = {200, 2})
public final void multi2() {
}
@MultiValue(ids = {200, 2})
public final void multi3() {
}
@MultiValueString(ids = {"A"})
public final void multi4() {
}
@MultiValueByte(ids = {1})
public final void multi5() {
}
@lib.OnClick(value = {200})
public final void multiJava1() {
}
@lib.OnClick(value = {200, 100})
public final void multiJava2() {
}
public final int getPropB() {
return 0;
}
public final int getPropC() {
return 0;
}
public final void setPropC(int p0) {
}
public final int getPropF() {
return 0;
}
}
////////////////////
package app;
public class R {
public R() {
super();
}
public static class layout {
public layout() {
super();
}
public static final int mainActivity = 100;
}
}
////////////////////
package app;
public class R2 {
public R2() {
super();
}
public static class layout {
public layout() {
super();
}
public static final int mainActivity = 100;
}
}
////////////////////
package lib;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target(value = ElementType.METHOD)
@Retention(value = RetentionPolicy.RUNTIME)
public @interface OnClick {
int[] value() default {};
}
////////////////////
package lib;
public class R {
public R() {
super();
}
public static class id {
public id() {
super();
}
public static final int textView = 100;
}
}
@@ -0,0 +1,106 @@
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface Anno {
}
////////////////////
@kotlin.Metadata()
public final class Bar {
@FieldAnno()
@org.jetbrains.annotations.NotNull()
private final java.lang.String a = "";
public Bar() {
super();
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getA() {
return null;
}
@PropertyAnno()
@Anno()
@java.lang.Deprecated()
public static void getA$annotations() {
}
}
////////////////////
@kotlin.Metadata()
public final class Baz {
@FieldAnno()
@kotlin.jvm.JvmField()
@org.jetbrains.annotations.NotNull()
public final java.lang.String a = "";
public Baz() {
super();
}
@Anno()
@java.lang.Deprecated()
public static void getA$annotations() {
}
}
////////////////////
@kotlin.Metadata()
@kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.FIELD})
@java.lang.annotation.Target(value = {java.lang.annotation.ElementType.FIELD})
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface FieldAnno {
}
////////////////////
@kotlin.Metadata()
public final class Foo {
@FieldAnno()
@org.jetbrains.annotations.NotNull()
private final java.lang.String a = null;
public Foo(@ParameterAnno()
@Anno()
@org.jetbrains.annotations.NotNull()
java.lang.String a) {
super();
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getA() {
return null;
}
@PropertyAnno()
@java.lang.Deprecated()
public static void getA$annotations() {
}
}
////////////////////
@kotlin.Metadata()
@kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.VALUE_PARAMETER})
@java.lang.annotation.Target(value = {java.lang.annotation.ElementType.PARAMETER})
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface ParameterAnno {
}
////////////////////
@kotlin.Metadata()
@kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.PROPERTY})
@java.lang.annotation.Target(value = {})
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface PropertyAnno {
}
@@ -0,0 +1,80 @@
@kotlin.Metadata()
public final class AnonymousDelegateKt {
public AnonymousDelegateKt() {
super();
}
@org.jetbrains.annotations.NotNull()
private static final java.lang.Object delegate$delegate = null;
@org.jetbrains.annotations.NotNull()
public static final java.lang.Object getDelegate() {
return null;
}
public static final void setDelegate(@org.jetbrains.annotations.NotNull()
java.lang.Object delegate) {
}
}
////////////////////
@kotlin.Metadata()
public final class ConcreteDelegate {
public ConcreteDelegate() {
super();
}
public final int getValue(@org.jetbrains.annotations.Nullable()
java.lang.Object t, @org.jetbrains.annotations.NotNull()
kotlin.reflect.KProperty<?> p) {
return 0;
}
}
////////////////////
@kotlin.Metadata()
public final class Test {
@org.jetbrains.annotations.NotNull()
private final java.lang.Object broken$delegate = null;
@org.jetbrains.annotations.NotNull()
private final java.io.Serializable overridden$delegate = null;
@org.jetbrains.annotations.NotNull()
private final kotlin.Lazy<java.lang.Runnable> lazyProp$delegate = null;
@org.jetbrains.annotations.NotNull()
private final ConcreteDelegate concreteDelegate$delegate = null;
public Test() {
super();
}
@org.jetbrains.annotations.NotNull()
public final java.lang.Object getBroken() {
return null;
}
public final void setBroken(@org.jetbrains.annotations.NotNull()
java.lang.Object broken) {
}
@org.jetbrains.annotations.NotNull()
public final java.lang.Object getOverridden() {
return null;
}
public final void setOverridden(@org.jetbrains.annotations.NotNull()
java.lang.Object overridden) {
}
private final java.lang.Runnable getLazyProp() {
return null;
}
public final int getConcreteDelegate() {
return 0;
}
}
@@ -0,0 +1,188 @@
@kotlin.Metadata()
@kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.PROPERTY})
@java.lang.annotation.Target(value = {})
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface Anno {
}
////////////////////
@kotlin.Metadata()
public enum EnumError {
/*public static final*/ One /* = new EnumError() */,
/*public static final*/ Two /* = new EnumError() */;
EnumError() {
}
@org.jetbrains.annotations.NotNull()
public abstract java.lang.String doIt();
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<EnumError> getEntries() {
return null;
}
}
////////////////////
/**
* Obj.
*/
@kotlin.Metadata()
public final class Obj {
@org.jetbrains.annotations.NotNull()
public static final Obj INSTANCE = null;
private Obj() {
super();
}
}
////////////////////
/**
* Test.
*/
@kotlin.Metadata()
public final class Test {
/**
* prop.
*/
@org.jetbrains.annotations.NotNull()
public final java.lang.String prop = "";
/**
* prop2.
*/
@org.jetbrains.annotations.NotNull()
private final java.lang.String prop2 = "";
public Test() {
super();
}
/**
* method().
*/
public final void method() {
}
/**
* method(int).
*/
public final void method(int a) {
}
/**
* method(String).
*/
public final void method(@org.jetbrains.annotations.NotNull()
java.lang.String a) {
}
/**
* prop2.
*/
@org.jetbrains.annotations.NotNull()
public final java.lang.String getProp2() {
return null;
}
/**
* prop2.
*/
@Anno()
@java.lang.Deprecated()
public static void getProp2$annotations() {
}
/**
* get.
*/
@org.jetbrains.annotations.NotNull()
public final java.lang.String getProp3() {
return null;
}
/**
* set.
*/
public final void setProp3(@org.jetbrains.annotations.NotNull()
java.lang.String v) {
}
}
////////////////////
/**
* Test2
* Multiline
* documentation.
*/
@kotlin.Metadata()
public final class Test2 {
@org.jetbrains.annotations.NotNull()
private final java.lang.String a = null;
public Test2(@org.jetbrains.annotations.NotNull()
java.lang.String a) {
super();
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getA() {
return null;
}
}
////////////////////
/**
* constructor.
*/
@kotlin.Metadata()
public final class Test3 {
@org.jetbrains.annotations.NotNull()
private final java.lang.String a = null;
protected Test3(@org.jetbrains.annotations.NotNull()
java.lang.String a) {
super();
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getA() {
return null;
}
}
////////////////////
@kotlin.Metadata()
public final class Test4 {
public Test4() {
super();
}
public final void method() {
}
}
////////////////////
/**
* `/ * Failure * /`
*/
@kotlin.Metadata()
public abstract interface TestComponent {
}
@@ -0,0 +1,142 @@
@kotlin.Metadata()
@kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.PROPERTY})
@java.lang.annotation.Target(value = {})
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface Anno {
}
////////////////////
@kotlin.Metadata()
public enum EnumError {
/*public static final*/ One /* = new EnumError() */,
/*public static final*/ Two /* = new EnumError() */;
EnumError() {
}
@org.jetbrains.annotations.NotNull()
public abstract java.lang.String doIt();
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<EnumError> getEntries() {
return null;
}
}
////////////////////
@kotlin.Metadata()
public final class Obj {
@org.jetbrains.annotations.NotNull()
public static final Obj INSTANCE = null;
private Obj() {
super();
}
}
////////////////////
@kotlin.Metadata()
public final class Test {
@org.jetbrains.annotations.NotNull()
public final java.lang.String prop = "";
@org.jetbrains.annotations.NotNull()
private final java.lang.String prop2 = "";
public Test() {
super();
}
public final void method() {
}
public final void method(int a) {
}
public final void method(@org.jetbrains.annotations.NotNull()
java.lang.String a) {
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getProp2() {
return null;
}
@Anno()
@java.lang.Deprecated()
public static void getProp2$annotations() {
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getProp3() {
return null;
}
public final void setProp3(@org.jetbrains.annotations.NotNull()
java.lang.String v) {
}
}
////////////////////
@kotlin.Metadata()
public final class Test2 {
@org.jetbrains.annotations.NotNull()
private final java.lang.String a = null;
public Test2(@org.jetbrains.annotations.NotNull()
java.lang.String a) {
super();
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getA() {
return null;
}
}
////////////////////
@kotlin.Metadata()
public final class Test3 {
@org.jetbrains.annotations.NotNull()
private final java.lang.String a = null;
protected Test3(@org.jetbrains.annotations.NotNull()
java.lang.String a) {
super();
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getA() {
return null;
}
}
////////////////////
@kotlin.Metadata()
public final class Test4 {
public Test4() {
super();
}
public final void method() {
}
}
////////////////////
@kotlin.Metadata()
public abstract interface TestComponent {
}
@@ -0,0 +1,66 @@
@kotlin.Metadata()
public final class User {
@org.jetbrains.annotations.NotNull()
private final java.lang.String firstName = null;
@org.jetbrains.annotations.NotNull()
private final java.lang.String secondName = null;
private final int age = 0;
@org.jetbrains.annotations.NotNull()
public final User copy(@org.jetbrains.annotations.NotNull()
java.lang.String firstName, @org.jetbrains.annotations.NotNull()
java.lang.String secondName, int age) {
return null;
}
public boolean equals(@org.jetbrains.annotations.Nullable()
java.lang.Object other) {
return false;
}
public int hashCode() {
return 0;
}
@org.jetbrains.annotations.NotNull()
public java.lang.String toString() {
return null;
}
public User(@org.jetbrains.annotations.NotNull()
java.lang.String firstName, @org.jetbrains.annotations.NotNull()
java.lang.String secondName, int age) {
super();
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String component1() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getFirstName() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String component2() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getSecondName() {
return null;
}
public final int component3() {
return 0;
}
public final int getAge() {
return 0;
}
public final void procedure() {
}
}
@@ -0,0 +1,41 @@
@kotlin.Metadata()
public abstract interface Intf {
@org.jetbrains.annotations.NotNull()
public static final Intf.Companion Companion = null;
public static final int WHITE = 2;
public default int getColor() {
return 0;
}
@kotlin.Metadata()
public static final class Companion {
private static final int BLACK = 1;
public static final int WHITE = 2;
private Companion() {
super();
}
public final int getBLACK() {
return 0;
}
}
}
////////////////////
@kotlin.Metadata()
public abstract interface IntfWithDefaultImpls {
public default void a() {
}
}
////////////////////
@kotlin.Metadata()
public abstract interface IntfWithoutDefaultImpls {
}
@@ -0,0 +1,10 @@
@kotlin.Metadata()
public abstract interface Foo<X extends java.lang.Object, Y extends java.lang.Object> {
public default <Z extends java.lang.Object>void foo(X x, Y y, Z z) {
}
public default int getX() {
return 0;
}
}
@@ -0,0 +1,64 @@
@kotlin.Metadata()
public final class AnotherRootClass {
public AnotherRootClass() {
super();
}
}
////////////////////
@kotlin.Metadata()
public final class RootClass {
public RootClass() {
super();
}
}
////////////////////
package test;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.annotation.ElementType;
@Target(value = {ElementType.TYPE, ElementType.METHOD})
@Retention(value = RetentionPolicy.RUNTIME)
public @interface ClassRefAnnotation {
Class<?>[] value();
}
////////////////////
package test;
@kotlin.Metadata()
public abstract interface PackedClass {
@org.jetbrains.annotations.NotNull()
public abstract RootClass someMethod();
@org.jetbrains.annotations.NotNull()
public abstract java.lang.Number otherMethod();
@org.jetbrains.annotations.NotNull()
public abstract AnotherRootClass oneMoreMethod();
}
////////////////////
package test;
@kotlin.Metadata()
@ClassRefAnnotation(value = {RootClass.class})
public final class PackedWithAnnotation {
public PackedWithAnnotation() {
super();
}
}
@@ -0,0 +1,64 @@
@kotlin.Metadata()
public final class AnotherRootClass {
public AnotherRootClass() {
super();
}
}
////////////////////
@kotlin.Metadata()
public final class RootClass {
public RootClass() {
super();
}
}
////////////////////
package test;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.annotation.ElementType;
@Target(value = {ElementType.TYPE, ElementType.METHOD})
@Retention(value = RetentionPolicy.RUNTIME)
public @interface ClassRefAnnotation {
Class<?>[] value();
}
////////////////////
package test;
@kotlin.Metadata()
public abstract interface PackedClass {
@org.jetbrains.annotations.NotNull()
public abstract RootClass someMethod();
@org.jetbrains.annotations.NotNull()
public abstract java.lang.Number otherMethod();
@org.jetbrains.annotations.NotNull()
public abstract AnotherRootClass oneMoreMethod();
}
////////////////////
package test;
@kotlin.Metadata()
@ClassRefAnnotation(value = {RootClass.class})
public final class PackedWithAnnotation {
public PackedWithAnnotation() {
super();
}
}
@@ -0,0 +1,148 @@
@kotlin.Metadata()
public enum Em {
/*public static final*/ FOO /* = new Em() */,
/*public static final*/ BAR /* = new Em() */;
Em() {
}
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<Em> getEntries() {
return null;
}
}
////////////////////
@kotlin.Metadata()
public final class Foo {
private final boolean z = false;
private final byte b = 0;
private final char c = '\u0000';
private final char c2 = '\u0000';
private final short sh = 0;
private final int i = 0;
private final long l = 0L;
private final float f = 0.0F;
private final double d = 0.0;
@org.jetbrains.annotations.NotNull()
private final java.lang.String s = null;
@org.jetbrains.annotations.NotNull()
private final int[] iarr = null;
@org.jetbrains.annotations.NotNull()
private final long[] larr = null;
@org.jetbrains.annotations.NotNull()
private final double[] darr = null;
@org.jetbrains.annotations.NotNull()
private final java.lang.String[] sarr = null;
@org.jetbrains.annotations.NotNull()
private final java.lang.Class<?> cl = null;
@org.jetbrains.annotations.NotNull()
private final java.lang.Class<?>[] clarr = null;
@org.jetbrains.annotations.NotNull()
private final Em em = null;
@org.jetbrains.annotations.NotNull()
private final Em[] emarr = null;
public Foo() {
super();
}
public Foo(boolean z, byte b, char c, char c2, short sh, int i, long l, float f, double d, @org.jetbrains.annotations.NotNull()
java.lang.String s, @org.jetbrains.annotations.NotNull()
int[] iarr, @org.jetbrains.annotations.NotNull()
long[] larr, @org.jetbrains.annotations.NotNull()
double[] darr, @org.jetbrains.annotations.NotNull()
java.lang.String[] sarr, @org.jetbrains.annotations.NotNull()
java.lang.Class<?> cl, @org.jetbrains.annotations.NotNull()
java.lang.Class<?>[] clarr, @org.jetbrains.annotations.NotNull()
Em em, @org.jetbrains.annotations.NotNull()
Em[] emarr) {
super();
}
public final boolean getZ() {
return false;
}
public final byte getB() {
return 0;
}
public final char getC() {
return '\u0000';
}
public final char getC2() {
return '\u0000';
}
public final short getSh() {
return 0;
}
public final int getI() {
return 0;
}
public final long getL() {
return 0L;
}
public final float getF() {
return 0.0F;
}
public final double getD() {
return 0.0;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getS() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final int[] getIarr() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final long[] getLarr() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final double[] getDarr() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String[] getSarr() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.Class<?> getCl() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.Class<?>[] getClarr() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final Em getEm() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final Em[] getEmarr() {
return null;
}
public final void foo(int a) {
}
}
@@ -0,0 +1,148 @@
@kotlin.Metadata()
public enum Em {
/*public static final*/ FOO /* = new Em() */,
/*public static final*/ BAR /* = new Em() */;
Em() {
}
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<Em> getEntries() {
return null;
}
}
////////////////////
@kotlin.Metadata()
public final class Foo {
private final boolean z = true;
private final byte b = (byte)0;
private final char c = 'c';
private final char c2 = '\n';
private final short sh = (short)10;
private final int i = 10;
private final long l = -10L;
private final float f = 1.0F;
private final double d = -1.0;
@org.jetbrains.annotations.NotNull()
private final java.lang.String s = "foo";
@org.jetbrains.annotations.NotNull()
private final int[] iarr = {1, 2, 3};
@org.jetbrains.annotations.NotNull()
private final long[] larr = {-1L, 0L, 1L};
@org.jetbrains.annotations.NotNull()
private final double[] darr = {7.3};
@org.jetbrains.annotations.NotNull()
private final java.lang.String[] sarr = {"a", "bc"};
@org.jetbrains.annotations.NotNull()
private final java.lang.Class<?> cl = null;
@org.jetbrains.annotations.NotNull()
private final java.lang.Class<?>[] clarr = {};
@org.jetbrains.annotations.NotNull()
private final Em em = Em.BAR;
@org.jetbrains.annotations.NotNull()
private final Em[] emarr = {Em.FOO, Em.BAR};
public Foo() {
super();
}
public Foo(boolean z, byte b, char c, char c2, short sh, int i, long l, float f, double d, @org.jetbrains.annotations.NotNull()
java.lang.String s, @org.jetbrains.annotations.NotNull()
int[] iarr, @org.jetbrains.annotations.NotNull()
long[] larr, @org.jetbrains.annotations.NotNull()
double[] darr, @org.jetbrains.annotations.NotNull()
java.lang.String[] sarr, @org.jetbrains.annotations.NotNull()
java.lang.Class<?> cl, @org.jetbrains.annotations.NotNull()
java.lang.Class<?>[] clarr, @org.jetbrains.annotations.NotNull()
Em em, @org.jetbrains.annotations.NotNull()
Em[] emarr) {
super();
}
public final boolean getZ() {
return false;
}
public final byte getB() {
return 0;
}
public final char getC() {
return '\u0000';
}
public final char getC2() {
return '\u0000';
}
public final short getSh() {
return 0;
}
public final int getI() {
return 0;
}
public final long getL() {
return 0L;
}
public final float getF() {
return 0.0F;
}
public final double getD() {
return 0.0;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getS() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final int[] getIarr() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final long[] getLarr() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final double[] getDarr() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String[] getSarr() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.Class<?> getCl() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.Class<?>[] getClarr() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final Em getEm() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final Em[] getEmarr() {
return null;
}
public final void foo(int a) {
}
}
@@ -1,3 +1,4 @@
// FIR_BLOCKED: KT-60480
class MyList<out T : Any>(
private val wrappedList: List<T>,
) : List<T> by wrappedList
@@ -0,0 +1,66 @@
package test;
@kotlin.Metadata()
public final class A {
@org.jetbrains.annotations.NotNull()
private final kotlin.Lazy x$delegate = null;
@org.jetbrains.annotations.NotNull()
private final test.C<java.lang.String> z$delegate = null;
@org.jetbrains.annotations.NotNull()
private final test.C<java.lang.String> y$delegate = null;
@org.jetbrains.annotations.NotNull()
private final kotlin.Lazy<test.C<java.lang.String>> a$delegate = null;
@org.jetbrains.annotations.NotNull()
private final kotlin.Lazy<test.C<java.lang.String>> b$delegate = null;
public A() {
super();
}
public final error.NonExistentClass getX() {
return null;
}
@kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"})
@java.lang.Deprecated()
public static void getX$annotations() {
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getZ() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getY() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final test.C<java.lang.String> getA() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final test.C<java.lang.String> getB() {
return null;
}
}
////////////////////
package test;
@kotlin.Metadata()
public class C<T extends java.lang.Object> {
public C(T v) {
super();
}
public final T getValue(@org.jetbrains.annotations.Nullable()
java.lang.Object p1, @org.jetbrains.annotations.Nullable()
java.lang.Object p2) {
return null;
}
}
@@ -1,3 +1,4 @@
// FIR_BLOCKED: KT-60490
// CORRECT_ERROR_TYPES
@Suppress("UNRESOLVED_REFERENCE")
@@ -1,3 +1,4 @@
// FIR_BLOCKED: KT-60960
package deprecated
@Deprecated("Deprecated annotation")
@@ -0,0 +1,16 @@
package kapt;
@kotlin.Metadata()
public enum Options {
/*public static final*/ A /* = new Options() */,
/*public static final*/ B /* = new Options() */,
/*public static final*/ C /* = new Options() */;
Options() {
}
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<kapt.Options> getEntries() {
return null;
}
}
@@ -0,0 +1,189 @@
@kotlin.Metadata()
public final class Test {
@org.jetbrains.annotations.NotNull()
private final Test.Companion.Example foo = Test.Companion.Example.FOO;
@org.jetbrains.annotations.NotNull()
public static final Test.Companion Companion = null;
public Test() {
super();
}
@kotlin.Metadata()
public static final class Companion {
private Companion() {
super();
}
@kotlin.Metadata()
public static enum Example {
/*public static final*/ FOO /* = new Example() */;
Example() {
}
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<Test.Companion.Example> getEntries() {
return null;
}
}
}
}
////////////////////
@kotlin.Metadata()
public final class Test2 {
@org.jetbrains.annotations.NotNull()
private final Test2.Amigo.Example foo = Test2.Amigo.Example.FOO;
@org.jetbrains.annotations.NotNull()
public static final Test2.Amigo Amigo = null;
public Test2() {
super();
}
@kotlin.Metadata()
public static final class Amigo {
private Amigo() {
super();
}
@kotlin.Metadata()
public static enum Example {
/*public static final*/ FOO /* = new Example() */;
Example() {
}
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<Test2.Amigo.Example> getEntries() {
return null;
}
}
}
}
////////////////////
@kotlin.Metadata()
public final class Test3 {
@org.jetbrains.annotations.NotNull()
private final Test3.Amigo.Example foo = Test3.Amigo.Example.FOO;
public Test3() {
super();
}
@kotlin.Metadata()
public static final class Amigo {
@org.jetbrains.annotations.NotNull()
public static final Test3.Amigo INSTANCE = null;
private Amigo() {
super();
}
@kotlin.Metadata()
public static enum Example {
/*public static final*/ FOO /* = new Example() */;
Example() {
}
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<Test3.Amigo.Example> getEntries() {
return null;
}
}
}
}
////////////////////
@kotlin.Metadata()
public final class Test4 {
private final int foo = 1;
@org.jetbrains.annotations.NotNull()
public static final Test4.Companion Companion = null;
public Test4() {
super();
}
@kotlin.Metadata()
public static final class Companion {
private Companion() {
super();
}
@kotlin.Metadata()
public static final class Foo {
@org.jetbrains.annotations.NotNull()
public static final Test4.Companion.Foo INSTANCE = null;
public static final int constProperty = 1;
private Foo() {
super();
}
}
}
}
////////////////////
@kotlin.Metadata()
public final class Test5 {
@org.jetbrains.annotations.NotNull()
private final Test5.Amigos.Companion.Goo.Example foo = Test5.Amigos.Companion.Goo.Example.FOO;
public Test5() {
super();
}
@kotlin.Metadata()
public static final class Amigos {
@org.jetbrains.annotations.NotNull()
public static final Test5.Amigos.Companion Companion = null;
public Amigos() {
super();
}
@kotlin.Metadata()
public static final class Companion {
private Companion() {
super();
}
@kotlin.Metadata()
public static final class Goo {
public Goo() {
super();
}
@kotlin.Metadata()
public static enum Example {
/*public static final*/ FOO /* = new Example() */;
Example() {
}
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<Test5.Amigos.Companion.Goo.Example> getEntries() {
return null;
}
}
}
}
}
}
@@ -0,0 +1,101 @@
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface Anno1 {
public abstract java.lang.String value();
}
////////////////////
@kotlin.Metadata()
public enum Enum1 {
/*public static final*/ BLACK /* = new Enum1() */,
/*public static final*/ WHITE /* = new Enum1() */;
Enum1() {
}
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<Enum1> getEntries() {
return null;
}
}
////////////////////
@kotlin.Metadata()
public enum Enum2 {
/*public static final*/ RED /* = new Enum2() */,
/*public static final*/ WHITE /* = new Enum2() */;
@org.jetbrains.annotations.NotNull()
private final java.lang.String col = null;
private final int col2 = 0;
Enum2(@Anno1(value = "first")
java.lang.String col, @Anno1(value = "second")
int col2) {
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getCol() {
return null;
}
public final int getCol2() {
return 0;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String color() {
return null;
}
private final void privateEnumFun() {
}
public final void publicEnumFun() {
}
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<Enum2> getEntries() {
return null;
}
}
////////////////////
@kotlin.Metadata()
public abstract interface I {
@kotlin.Metadata()
public static enum Nested {
/*public static final*/ WHITE /* = new Nested() */;
Nested() {
}
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<I.Nested> getEntries() {
return null;
}
}
}
////////////////////
@kotlin.Metadata()
public enum Nested1 {
/*public static final*/ WHITE /* = new Nested1() */;
Nested1() {
}
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<Nested1> getEntries() {
return null;
}
}
@@ -1,3 +1,4 @@
// !LANGUAGE: +EnumEntries
enum class Enum1 {
BLACK, WHITE
}
@@ -0,0 +1,140 @@
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface Anno {
public abstract java.lang.Class<java.lang.Object> a();
}
////////////////////
@kotlin.Metadata()
@Anno(a = ABC.class)
public final class ErrorInAnnotation {
public ErrorInAnnotation() {
super();
}
}
////////////////////
@kotlin.Metadata()
public final class ErrorInConstructorParameter {
@org.jetbrains.annotations.NotNull()
private final java.lang.String a = null;
@org.jetbrains.annotations.NotNull()
private final ABC b = null;
@org.jetbrains.annotations.NotNull()
private final java.util.List<ABC> c = null;
public ErrorInConstructorParameter(@org.jetbrains.annotations.NotNull()
java.lang.String a, @org.jetbrains.annotations.NotNull()
ABC b, @org.jetbrains.annotations.NotNull()
java.util.List<? extends ABC> c) {
super();
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getA() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final ABC getB() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.util.List<ABC> getC() {
return null;
}
}
////////////////////
@kotlin.Metadata()
public final class ErrorInDeclarations {
public java.lang.String p1;
public ABC p2;
public BCD<java.lang.String> p3;
public ErrorInDeclarations() {
super();
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getP1() {
return null;
}
public final void setP1(@org.jetbrains.annotations.NotNull()
java.lang.String p0) {
}
@org.jetbrains.annotations.NotNull()
public final ABC getP2() {
return null;
}
public final void setP2(@org.jetbrains.annotations.NotNull()
ABC p0) {
}
@org.jetbrains.annotations.NotNull()
public final BCD<java.lang.String> getP3() {
return null;
}
public final void setP3(@org.jetbrains.annotations.NotNull()
BCD<java.lang.String> p0) {
}
public final void overloads(@org.jetbrains.annotations.NotNull()
java.lang.String a) {
}
public final void overloads(@org.jetbrains.annotations.NotNull()
ABC a) {
}
public final void f1(@org.jetbrains.annotations.NotNull()
java.lang.String a, @org.jetbrains.annotations.NotNull()
ABC<java.util.List<java.lang.String>> b) {
}
public final <T extends java.lang.String>void f2() {
}
public final <T extends java.lang.Object>void f3() {
}
@org.jetbrains.annotations.NotNull()
public final ABC f4() {
return null;
}
}
////////////////////
@kotlin.Metadata()
public final class ErrorInSupertype implements ABC {
public ErrorInSupertype() {
super();
}
}
////////////////////
@kotlin.Metadata()
public final class ErrorInSupertype2 extends ABC<java.lang.String> {
public ErrorInSupertype2() {
super();
}
}
@@ -0,0 +1,20 @@
package test;
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface Anno {
}
////////////////////
package test;
@kotlin.Metadata()
@Anno()
@kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"})
public final class ClassWithParent extends Foo implements Bar, Baz, java.lang.CharSequence {
public ClassWithParent() {
super();
}
}
@@ -1,3 +1,5 @@
// EXPECTED_ERROR_K2: (kotlin:7:1) cannot find symbol
package test
internal annotation class Anno
@@ -0,0 +1,262 @@
package test;
@kotlin.Metadata()
public final class Child extends kotlin.collections.AbstractList<java.lang.String> implements test.Parent<java.lang.String, java.lang.Integer>, java.util.List<java.lang.String>, kotlin.jvm.internal.markers.KMappedMarker {
public Child() {
super();
}
}
////////////////////
package test;
@kotlin.Metadata()
public class Cl {
public Cl() {
super();
}
}
////////////////////
package test;
@kotlin.Metadata()
public final class Generics1 extends Foo<java.lang.String> {
public Generics1() {
super();
}
}
////////////////////
package test;
@kotlin.Metadata()
public final class Generics2 implements Foo<java.lang.String> {
public Generics2() {
super();
}
}
////////////////////
package test;
@kotlin.Metadata()
public final class Generics3 implements Foo<Bar, Baz, Boo<Baz, java.util.List<?>>, java.lang.String> {
public Generics3() {
super();
}
}
////////////////////
package test;
@kotlin.Metadata()
public abstract interface Intf {
}
////////////////////
package test;
@kotlin.Metadata()
public final class MappedList<R extends java.lang.Object> extends kotlin.collections.AbstractList<R> implements java.util.List<R>, kotlin.jvm.internal.markers.KMappedMarker {
public MappedList() {
super();
}
@org.jetbrains.annotations.NotNull()
@java.lang.Override()
public java.lang.Void get(int index) {
return null;
}
@java.lang.Override()
public int getSize() {
return 0;
}
}
////////////////////
package test;
@kotlin.Metadata()
public abstract interface Parent<A extends java.lang.CharSequence, B extends java.lang.Object> {
}
////////////////////
package test;
@kotlin.Metadata()
public final class TBarBazCl extends test.Cl implements Bar, Baz {
public TBarBazCl() {
super();
}
}
////////////////////
package test;
@kotlin.Metadata()
public final class TClBarBaz extends test.Cl implements Bar, Baz {
public TClBarBaz() {
super();
}
}
////////////////////
package test;
@kotlin.Metadata()
public final class TFooBar extends Foo implements Bar, test.Intf {
@org.jetbrains.annotations.NotNull()
private final X a = null;
public TFooBar(@org.jetbrains.annotations.NotNull()
X a) {
super();
}
@org.jetbrains.annotations.NotNull()
public final X getA() {
return null;
}
}
////////////////////
package test;
@kotlin.Metadata()
public final class TFooBar2 implements Foo, Bar {
@org.jetbrains.annotations.NotNull()
private final X a = null;
public TFooBar2(@org.jetbrains.annotations.NotNull()
X a) {
super();
}
@org.jetbrains.annotations.NotNull()
public final X getA() {
return null;
}
}
////////////////////
package test;
@kotlin.Metadata()
public final class TFooBarBaz extends Foo implements Bar, Baz {
public TFooBarBaz() {
super();
}
}
////////////////////
package test;
@kotlin.Metadata()
public final class TFooBarBaz2 extends Foo implements Baz, test.Intf {
public TFooBarBaz2() {
super();
}
}
////////////////////
package test;
@kotlin.Metadata()
public final class TFooBarBaz3 implements Foo, Bar, Baz {
public TFooBarBaz3() {
super();
}
}
////////////////////
package test;
@kotlin.Metadata()
public final class TFooBarBaz4 implements Foo, Bar, Baz {
public TFooBarBaz4() {
super();
}
}
////////////////////
package test;
@kotlin.Metadata()
public final class TFooBarBaz5 implements Foo, Bar, Baz {
public TFooBarBaz5() {
super();
}
public TFooBarBaz5(@org.jetbrains.annotations.NotNull()
java.lang.String s) {
super();
}
}
////////////////////
package test;
@kotlin.Metadata()
public final class TFooBarBaz6 implements Foo, Bar, Baz {
public TFooBarBaz6(@org.jetbrains.annotations.NotNull()
java.lang.String s) {
super();
}
}
////////////////////
package test;
@kotlin.Metadata()
public final class TxFooxBarxBaz extends x.Foo implements x.Bar, x.Baz, test.Intf {
public TxFooxBarxBaz() {
super();
}
}
////////////////////
package test;
@kotlin.Metadata()
public final class TxFooxBarxBaz2 extends x.Foo implements x.Bar {
public TxFooxBarxBaz2() {
super();
}
}
@@ -0,0 +1,28 @@
@kotlin.Metadata()
public final class MappedList<T extends java.lang.Object, R extends java.lang.Object> extends kotlin.collections.AbstractList<R> implements java.util.List<R>, kotlin.jvm.internal.markers.KMappedMarker {
@org.jetbrains.annotations.NotNull()
private final java.util.List<T> list = null;
@org.jetbrains.annotations.NotNull()
private final kotlin.jvm.functions.Function1<T, R> function = null;
public MappedList(@org.jetbrains.annotations.NotNull()
java.util.List<? extends T> list, @org.jetbrains.annotations.NotNull()
kotlin.jvm.functions.Function1<? super T, ? extends R> function) {
super();
}
@org.jetbrains.annotations.NotNull()
public final java.util.List<T> getList() {
return null;
}
@java.lang.Override()
public R get(int index) {
return null;
}
@java.lang.Override()
public int getSize() {
return 0;
}
}
@@ -15,8 +15,6 @@ public abstract class Prop<T> {
package test;
import java.lang.System;
@kotlin.Metadata()
public final class Cl {
@org.jetbrains.annotations.NotNull()
@@ -41,8 +39,6 @@ public final class Cl {
package test;
import java.lang.System;
@kotlin.Metadata()
public final class TestKt {
@@ -0,0 +1,12 @@
@kotlin.Metadata()
public final class ImportsForErrorTypesKt {
public ImportsForErrorTypesKt() {
super();
}
@org.jetbrains.annotations.Nullable()
public static final java.lang.Object test() {
return null;
}
}
@@ -0,0 +1,76 @@
package lib;
public class File {
public File() {
super();
}
}
////////////////////
package lib;
public class IOException {
public IOException() {
super();
}
}
////////////////////
package test;
@kotlin.Metadata()
public final class TestA {
public TestA() {
super();
}
}
////////////////////
package test;
@kotlin.Metadata()
public abstract interface TestB {
@org.jetbrains.annotations.NotNull()
public abstract java.io.File a();
@org.jetbrains.annotations.NotNull()
public abstract lib.File b();
@org.jetbrains.annotations.NotNull()
public abstract java.io.IOException c();
@org.jetbrains.annotations.NotNull()
public abstract lib.IOException d();
}
////////////////////
package test;
import lib.FooBar;
@kotlin.Metadata()
public abstract interface TestC {
@org.jetbrains.annotations.NotNull()
public abstract java.io.File a();
@org.jetbrains.annotations.NotNull()
public abstract lib.File b();
@org.jetbrains.annotations.NotNull()
public abstract java.io.IOException c();
@org.jetbrains.annotations.NotNull()
public abstract lib.IOException d();
@org.jetbrains.annotations.NotNull()
public abstract lib.FooBar e();
}
@@ -1,7 +1,6 @@
// CORRECT_ERROR_TYPES
// EXPECTED_ERROR: (kotlin:16:5) cannot find symbol
// EXPECTED_ERROR: (kotlin:15:5) cannot find symbol
// FILE: a.kt
package test
@@ -0,0 +1,50 @@
@kotlin.Metadata()
public final class GroupedNewsListDelegateAdapter {
public GroupedNewsListDelegateAdapter(@org.jetbrains.annotations.NotNull()
kotlin.jvm.functions.Function0<kotlin.Unit> onWiFiClickListener) {
super();
}
}
////////////////////
@kotlin.Metadata()
public final class HomeFragment {
@org.jetbrains.annotations.NotNull()
private final kotlin.Unit categoryNewsListPresenter$delegate = null;
@org.jetbrains.annotations.NotNull()
private final kotlin.Lazy<GroupedNewsListDelegateAdapter> groupedNewsListAdapter$delegate = null;
public HomeFragment() {
super();
}
private final error.NonExistentClass getCategoryNewsListPresenter() {
return null;
}
@kotlin.Suppress(names = {"TOO_MANY_ARGUMENTS", "DELEGATE_SPECIAL_FUNCTION_MISSING"})
@java.lang.Deprecated()
private static void getCategoryNewsListPresenter$annotations() {
}
private final GroupedNewsListDelegateAdapter getGroupedNewsListAdapter() {
return null;
}
}
////////////////////
@kotlin.Metadata()
public final class IncorrectDelegateKt {
public IncorrectDelegateKt() {
super();
}
public static final void moxyPresenter() {
}
}
@@ -1,3 +1,5 @@
// WITH_STDLIB
class HomeFragment {
@Suppress("TOO_MANY_ARGUMENTS", "DELEGATE_SPECIAL_FUNCTION_MISSING")
private val categoryNewsListPresenter by moxyPresenter {
@@ -0,0 +1,53 @@
@kotlin.Metadata()
public abstract class BaseClass {
public BaseClass(@org.jetbrains.annotations.NotNull()
Context context, int num, boolean bool) {
super();
}
@org.jetbrains.annotations.NotNull()
public abstract Result doJob();
}
////////////////////
@kotlin.Metadata()
public abstract interface Context {
}
////////////////////
@kotlin.Metadata()
public final class Inheritor extends BaseClass {
public Inheritor(@org.jetbrains.annotations.NotNull()
Context context) {
super(null, 0, false);
}
@org.jetbrains.annotations.NotNull()
@java.lang.Override()
public Result doJob() {
return null;
}
}
////////////////////
@kotlin.Metadata()
public enum Result {
/*public static final*/ SUCCESS /* = new Result() */,
/*public static final*/ ERROR /* = new Result() */;
Result() {
}
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<Result> getEntries() {
return null;
}
}
@@ -0,0 +1,14 @@
@kotlin.Metadata()
public final class Cl {
public Cl() {
super();
}
@org.jetbrains.annotations.NotNull()
private final java.lang.String a = null;
@org.jetbrains.annotations.NotNull()
public final java.lang.String getA() {
return null;
}
}
@@ -0,0 +1,67 @@
@kotlin.Metadata()
public final class Test {
@org.jetbrains.annotations.NotNull()
private Test.FilterValueDelegate<java.lang.Float> a;
public Test() {
super();
}
@kotlin.Metadata()
private final class FilterValueDelegate<T extends java.lang.Object> {
public FilterValueDelegate() {
super();
}
}
}
////////////////////
@kotlin.Metadata()
public final class Test2 {
public Test2() {
super();
}
@kotlin.Metadata()
public final class FilterValueDelegate<T extends java.lang.Object> {
@org.jetbrains.annotations.NotNull()
private Test2.FilterValueDelegate<T>.Filter2<java.lang.String> a;
public FilterValueDelegate() {
super();
}
@kotlin.Metadata()
public final class Filter2<X extends java.lang.Object> {
public Filter2() {
super();
}
}
}
}
////////////////////
@kotlin.Metadata()
public final class Test3 {
@org.jetbrains.annotations.NotNull()
private Test3.FilterValueDelegate<java.lang.Float> a;
public Test3() {
super();
}
@kotlin.Metadata()
private static final class FilterValueDelegate<T extends java.lang.Object> {
public FilterValueDelegate() {
super();
}
}
}
@@ -0,0 +1,30 @@
@kotlin.Metadata()
public abstract interface Named {
@org.jetbrains.annotations.Nullable()
public abstract java.lang.String getName();
}
////////////////////
@kotlin.Metadata()
public final class Product2 implements Named {
@org.jetbrains.annotations.Nullable()
private java.lang.String name = null;
@org.jetbrains.annotations.Nullable()
@java.lang.Override()
public java.lang.String getName() {
return null;
}
public void setName(@org.jetbrains.annotations.Nullable()
java.lang.String p0) {
}
public Product2(@org.jetbrains.annotations.NotNull()
java.lang.String otherName) {
super();
}
}
@@ -1,3 +1,4 @@
// FIR_BLOCKED: LC don't support illegal java identifiers
enum class Color {
BLACK, `WHI-TE`
}
@@ -5,5 +6,5 @@ enum class Color {
@Anno(Color.`WHI-TE`)
annotation class Anno(val color: Color)
// EXPECTED_ERROR: (kotlin:5:1) an enum annotation value must be an enum constant
// EXPECTED_ERROR: (kotlin:6:1) an enum annotation value must be an enum constant
// EXPECTED_ERROR: (other:-1:-1) 'WHI-TE' is an invalid Java enum value name
@@ -0,0 +1,169 @@
package javadoc;
/**
* Simple
*/
@kotlin.Metadata()
public final class A {
public A() {
super();
}
}
////////////////////
package javadoc;
/**
* Multi
* line
* comment.
*/
@kotlin.Metadata()
public final class B {
/**
* Nested
* member
* comment.
*/
@org.jetbrains.annotations.NotNull()
private final java.lang.String a = "";
/**
* Mixed
* tabs/spaces
*/
@org.jetbrains.annotations.NotNull()
private final java.lang.String b = "";
/**
* List:
* * first item
* * second item
*/
@org.jetbrains.annotations.NotNull()
private final java.lang.String c = "";
/**
* Without
* stars
*/
@org.jetbrains.annotations.NotNull()
private final java.lang.String d = "";
/**
* A mutable property
*/
@org.jetbrains.annotations.NotNull()
private java.lang.String e = "";
/**
* A property with a backing field and an explicit setter
*/
@org.jetbrains.annotations.NotNull()
private java.lang.String g;
public B() {
super();
}
/**
* Nested
* member
* comment.
*/
@org.jetbrains.annotations.NotNull()
public final java.lang.String getA() {
return null;
}
/**
* Mixed
* tabs/spaces
*/
@org.jetbrains.annotations.NotNull()
public final java.lang.String getB() {
return null;
}
/**
* List:
* * first item
* * second item
*/
@org.jetbrains.annotations.NotNull()
public final java.lang.String getC() {
return null;
}
/**
* Without
* stars
*/
@org.jetbrains.annotations.NotNull()
public final java.lang.String getD() {
return null;
}
/**
* A mutable property
*/
@org.jetbrains.annotations.NotNull()
public final java.lang.String getE() {
return null;
}
/**
* A mutable property
*/
public final void setE(@org.jetbrains.annotations.NotNull()
java.lang.String p0) {
}
/**
* A property without a backing field
*/
@org.jetbrains.annotations.NotNull()
public final java.lang.String getF() {
return null;
}
/**
* A property without a backing field
*/
public final void setF(@org.jetbrains.annotations.NotNull()
java.lang.String value) {
}
/**
* A property with a backing field and an explicit setter
*/
@org.jetbrains.annotations.NotNull()
public final java.lang.String getG() {
return null;
}
/**
* A property with a backing field and an explicit setter
*/
public final void setG(@org.jetbrains.annotations.NotNull()
java.lang.String value) {
}
/**
* It's a getter
*/
@org.jetbrains.annotations.NotNull()
public final java.lang.String getH() {
return null;
}
/**
* A property with documentation for an accessor
*/
public final void setH(@org.jetbrains.annotations.NotNull()
java.lang.String value) {
}
}
@@ -53,6 +53,18 @@ public final class B {
@org.jetbrains.annotations.NotNull()
private final java.lang.String d = "";
/**
* A mutable property
*/
@org.jetbrains.annotations.NotNull()
private java.lang.String e = "";
/**
* A property with a backing field and an explicit setter
*/
@org.jetbrains.annotations.NotNull()
private java.lang.String g;
public B() {
super();
}
@@ -94,4 +106,52 @@ public final class B {
public final java.lang.String getD() {
return null;
}
/**
* A mutable property
*/
@org.jetbrains.annotations.NotNull()
public final java.lang.String getE() {
return null;
}
/**
* A mutable property
*/
public final void setE(@org.jetbrains.annotations.NotNull()
java.lang.String p0) {
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getF() {
return null;
}
public final void setF(@org.jetbrains.annotations.NotNull()
java.lang.String value) {
}
/**
* A property with a backing field and an explicit setter
*/
@org.jetbrains.annotations.NotNull()
public final java.lang.String getG() {
return null;
}
public final void setG(@org.jetbrains.annotations.NotNull()
java.lang.String value) {
}
/**
* It's a getter
*/
@org.jetbrains.annotations.NotNull()
public final java.lang.String getH() {
return null;
}
public final void setH(@org.jetbrains.annotations.NotNull()
java.lang.String value) {
}
}
+34 -6
View File
@@ -14,10 +14,10 @@ class B {
* comment. */
val a = ""
/**
* Mixed
* tabs/spaces
*/
/**
* Mixed
* tabs/spaces
*/
val b = ""
/**
@@ -28,8 +28,36 @@ class B {
val c = ""
/**
Without
stars
Without
stars
*/
val d = ""
/**
* A mutable property
*/
var e = ""
/**
* A property without a backing field
*/
var f: String
get() = ""
set(value) {}
/**
* A property with a backing field and an explicit setter
*/
var g: String
set(value) {}
/**
* A property with documentation for an accessor
*/
var h: String
/**
* It's a getter
*/
get() = ""
set(value) {}
}
@@ -53,6 +53,18 @@ public final class B {
@org.jetbrains.annotations.NotNull()
private final java.lang.String d = "";
/**
* A mutable property
*/
@org.jetbrains.annotations.NotNull()
private java.lang.String e = "";
/**
* A property with a backing field and an explicit setter
*/
@org.jetbrains.annotations.NotNull()
private java.lang.String g;
public B() {
super();
}
@@ -76,4 +88,43 @@ public final class B {
public final java.lang.String getD() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getE() {
return null;
}
public final void setE(@org.jetbrains.annotations.NotNull()
java.lang.String p0) {
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getF() {
return null;
}
public final void setF(@org.jetbrains.annotations.NotNull()
java.lang.String value) {
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getG() {
return null;
}
public final void setG(@org.jetbrains.annotations.NotNull()
java.lang.String value) {
}
/**
* It's a getter
*/
@org.jetbrains.annotations.NotNull()
public final java.lang.String getH() {
return null;
}
public final void setH(@org.jetbrains.annotations.NotNull()
java.lang.String value) {
}
}
@@ -1,5 +1,6 @@
// FIR_BLOCKED: KT-59287
// !JVM_DEFAULT_MODE: all
// EXPECTED_ERROR: (kotlin:15:5) modifier private not allowed here
// EXPECTED_ERROR: (kotlin:16:5) modifier private not allowed here
interface Foo {
fun foo() {
@@ -1,5 +1,6 @@
// FIR_BLOCKED: KT-59287
// !JVM_DEFAULT_MODE: all-compatibility
// EXPECTED_ERROR: (kotlin:15:5) modifier private not allowed here
// EXPECTED_ERROR: (kotlin:16:5) modifier private not allowed here
interface Foo {
fun foo() {
@@ -1,4 +1,4 @@
// FIR_BLOCKED: support of @JvmOverloads in LC
class State @JvmOverloads constructor(
val someInt: Int,
val someLong: Long,
@@ -0,0 +1,19 @@
@kotlin.Metadata()
@Condition(condition = "value1")
@Condition(condition = "value2")
public final class A {
public A() {
super();
}
}
////////////////////
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface Condition {
public abstract java.lang.String condition();
}
@@ -0,0 +1,66 @@
@kotlin.Metadata()
public abstract interface FooComponent {
@org.jetbrains.annotations.NotNull()
public static final FooComponent.Companion Companion = null;
@kotlin.jvm.JvmStatic()
@org.jetbrains.annotations.NotNull()
public static java.lang.String create(@org.jetbrains.annotations.NotNull()
java.lang.String context) {
return null;
}
@kotlin.Metadata()
public static final class Companion {
private Companion() {
super();
}
@kotlin.jvm.JvmStatic()
@org.jetbrains.annotations.NotNull()
public final java.lang.String create(@org.jetbrains.annotations.NotNull()
java.lang.String context) {
return null;
}
}
}
////////////////////
@kotlin.Metadata()
public final class JvmStaticTest {
@org.jetbrains.annotations.NotNull()
public static final JvmStaticTest.Companion Companion = null;
private static final int one = 1;
public static final int two = 2;
public static final char c = 'C';
public final byte three = (byte)3;
public final char d = 'D';
public JvmStaticTest() {
super();
}
public static final int getOne() {
return 0;
}
@kotlin.Metadata()
public static final class Companion {
private Companion() {
super();
}
public final int getOne() {
return 0;
}
@kotlin.jvm.JvmStatic()
@java.lang.Deprecated()
public static void getOne$annotations() {
}
}
}
@@ -0,0 +1,34 @@
@kotlin.Metadata()
public final class Test {
@org.jetbrains.annotations.NotNull()
public static final Test.A A = null;
@org.jetbrains.annotations.NotNull()
private static final java.lang.String test = "";
public Test() {
super();
}
@org.jetbrains.annotations.NotNull()
public static final java.lang.String getTest() {
return null;
}
@kotlin.Metadata()
public static final class A {
private A() {
super();
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getTest() {
return null;
}
@kotlin.jvm.JvmStatic()
@java.lang.Deprecated()
public static void getTest$annotations() {
}
}
}
@@ -0,0 +1,19 @@
@kotlin.Metadata()
public final class Kt14996Kt {
public Kt14996Kt() {
super();
}
@org.jetbrains.annotations.NotNull()
public static final java.lang.CharSequence crashMe(@org.jetbrains.annotations.NotNull()
java.util.List<? extends java.lang.CharSequence> values) {
return null;
}
@org.jetbrains.annotations.NotNull()
public static final java.lang.String crashMe(@org.jetbrains.annotations.NotNull()
java.util.List<java.lang.String> values) {
return null;
}
}
@@ -0,0 +1,62 @@
@kotlin.Metadata()
public class CrashMe {
@org.jetbrains.annotations.NotNull()
private final java.lang.Runnable notReally = null;
public CrashMe() {
super();
}
}
////////////////////
@kotlin.Metadata()
@kotlin.Suppress(names = {"AMBIGUOUS_ANONYMOUS_TYPE_INFERRED"})
public final class Kt14997Kt {
public Kt14997Kt() {
super();
}
@org.jetbrains.annotations.NotNull()
public static final java.lang.Runnable a() {
return null;
}
@org.jetbrains.annotations.NotNull()
public static final java.io.Serializable b() {
return null;
}
@org.jetbrains.annotations.NotNull()
public static final CrashMe c() {
return null;
}
@org.jetbrains.annotations.NotNull()
public static final java.util.List<java.lang.Runnable> d() {
return null;
}
@org.jetbrains.annotations.NotNull()
public static final java.lang.Runnable[] e() {
return null;
}
public static final void e1(@org.jetbrains.annotations.NotNull()
java.lang.CharSequence[] a) {
}
public static final void e2(@org.jetbrains.annotations.NotNull()
java.lang.Object[] a) {
}
public static final void e3(@org.jetbrains.annotations.NotNull()
java.lang.CharSequence[] a) {
}
public static final void e3(@org.jetbrains.annotations.NotNull()
java.lang.Object[] a) {
}
}
@@ -0,0 +1,59 @@
@kotlin.Metadata()
public final class Outer {
public Outer() {
super();
}
public final void nonAbstract(@org.jetbrains.annotations.NotNull()
java.lang.String s, int i) {
}
@kotlin.Metadata()
private final class Inner {
@org.jetbrains.annotations.NotNull()
private final java.lang.String foo = null;
@org.jetbrains.annotations.NotNull()
private final java.lang.String bar = null;
public Inner(@org.jetbrains.annotations.NotNull()
java.lang.String foo, @org.jetbrains.annotations.NotNull()
java.lang.String bar) {
super();
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getFoo() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getBar() {
return null;
}
}
@kotlin.Metadata()
private static final class Nested {
@org.jetbrains.annotations.NotNull()
private final java.lang.String foo = null;
@org.jetbrains.annotations.NotNull()
private final java.lang.String bar = null;
public Nested(@org.jetbrains.annotations.NotNull()
java.lang.String foo, @org.jetbrains.annotations.NotNull()
java.lang.String bar) {
super();
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getFoo() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getBar() {
return null;
}
}
}
@@ -4,3 +4,8 @@ internal class MutableEntry<K, V>(
private val internal: MutableMap<K, V>,
override val key: K, value: V
): MutableMap.MutableEntry<K, V>
// <K:Ljava/lang/Object;V:Ljava/lang/Object;>
// Ljava/lang/Object;
// Ljava/util/Map$Entry<TK;TV;>;
// Lkotlin/jvm/internal/markers/KMutableMap$Entry;
@@ -0,0 +1,38 @@
@kotlin.Metadata()
public abstract class Foo {
public Foo() {
super();
}
}
////////////////////
@kotlin.Metadata()
public final class Kt18682Kt {
public Kt18682Kt() {
super();
}
@org.jetbrains.annotations.NotNull()
public static final java.util.List<java.lang.Object> test1() {
return null;
}
@org.jetbrains.annotations.NotNull()
public static final java.util.List<java.lang.Runnable> test2() {
return null;
}
@org.jetbrains.annotations.NotNull()
public static final java.util.List<Foo> test3() {
return null;
}
@org.jetbrains.annotations.NotNull()
public static final java.util.List<Foo> test4() {
return null;
}
}
@@ -0,0 +1,99 @@
package test;
@kotlin.Metadata()
public abstract class BundleProperty<AA extends java.lang.Object> extends test.NullableBundleProperty<AA> {
public BundleProperty(@org.jetbrains.annotations.Nullable()
java.lang.String key) {
super(null);
}
@java.lang.Override()
public final void setValue(@org.jetbrains.annotations.NotNull()
java.lang.Object thisRef, @org.jetbrains.annotations.NotNull()
kotlin.reflect.KProperty<?> property, @org.jetbrains.annotations.Nullable()
AA value) {
}
@java.lang.Override()
public final AA getValue(@org.jetbrains.annotations.NotNull()
java.lang.Object thisRef, @org.jetbrains.annotations.NotNull()
kotlin.reflect.KProperty<?> property) {
return null;
}
@java.lang.Override()
public final void setNullableValue(@org.jetbrains.annotations.NotNull()
java.lang.Object bundle, @org.jetbrains.annotations.NotNull()
java.lang.String key, @org.jetbrains.annotations.Nullable()
AA value) {
}
public abstract void setValue(@org.jetbrains.annotations.NotNull()
java.lang.Object bundle, @org.jetbrains.annotations.NotNull()
java.lang.String key, AA value);
}
////////////////////
package test;
@kotlin.Metadata()
@kotlin.Suppress(names = {"NOTHING_TO_INLINE"})
public final class Kt27126Kt {
public Kt27126Kt() {
super();
}
@org.jetbrains.annotations.NotNull()
public static final test.BundleProperty<java.lang.CharSequence> charSequence(@org.jetbrains.annotations.Nullable()
java.lang.String key) {
return null;
}
}
////////////////////
package test;
@kotlin.Metadata()
public abstract class NullableBundleProperty<EE extends java.lang.Object> implements kotlin.properties.ReadWriteProperty<java.lang.Object, EE> {
@org.jetbrains.annotations.Nullable()
private final java.lang.String key = null;
public NullableBundleProperty(@org.jetbrains.annotations.Nullable()
java.lang.String key) {
super();
}
private final java.lang.String toKey(@org.jetbrains.annotations.NotNull()
kotlin.reflect.KProperty<?> $this$toKey) {
return null;
}
@org.jetbrains.annotations.Nullable()
@java.lang.Override()
public EE getValue(@org.jetbrains.annotations.NotNull()
java.lang.Object thisRef, @org.jetbrains.annotations.NotNull()
kotlin.reflect.KProperty<?> property) {
return null;
}
@java.lang.Override()
public void setValue(@org.jetbrains.annotations.NotNull()
java.lang.Object thisRef, @org.jetbrains.annotations.NotNull()
kotlin.reflect.KProperty<?> property, @org.jetbrains.annotations.Nullable()
EE value) {
}
@org.jetbrains.annotations.Nullable()
public abstract EE getValue(@org.jetbrains.annotations.NotNull()
java.lang.Object bundle, @org.jetbrains.annotations.NotNull()
java.lang.String key);
public abstract void setNullableValue(@org.jetbrains.annotations.NotNull()
java.lang.Object bundle, @org.jetbrains.annotations.NotNull()
java.lang.String key, @org.jetbrains.annotations.Nullable()
EE value);
}
@@ -0,0 +1,16 @@
package foo;
@kotlin.Metadata()
public abstract interface InterfaceWithDefaults<T extends java.lang.Object> {
public default void foo() {
}
}
////////////////////
package foo;
@kotlin.Metadata()
public abstract interface SubInterface<T extends java.lang.Object> extends foo.InterfaceWithDefaults<T> {
}
+4 -3
View File
@@ -1,3 +1,4 @@
// FIR_BLOCKED: KT-60482
// CORRECT_ERROR_TYPES
@file:Suppress("UNRESOLVED_REFERENCE", "ANNOTATION_ARGUMENT_MUST_BE_CONST")
@@ -14,6 +15,6 @@ class ErrorSomeMissingAnnotations
annotation class Anno(val klass: KClass<*>)
// EXPECTED_ERROR: (kotlin:9:1) cannot find symbol
// EXPECTED_ERROR: (kotlin:12:1) cannot find symbol
// EXPECTED_ERROR: (kotlin:6:1) cannot find symbol
// EXPECTED_ERROR: (kotlin:10:1) cannot find symbol
// EXPECTED_ERROR: (kotlin:13:1) cannot find symbol
// EXPECTED_ERROR: (kotlin:7:1) cannot find symbol
@@ -0,0 +1,52 @@
@kotlin.Metadata()
@kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"})
public final class Application {
public DataStore<Preferences> _preferencesDataStore;
@org.jetbrains.annotations.NotNull()
public static final Application.Companion Companion = null;
public Application() {
super();
}
@org.jetbrains.annotations.NotNull()
public final DataStore<Preferences> get_preferencesDataStore() {
return null;
}
public final void set_preferencesDataStore(@org.jetbrains.annotations.NotNull()
DataStore<Preferences> p0) {
}
@kotlin.jvm.JvmStatic()
@org.jetbrains.annotations.NotNull()
public static final Application get() {
return null;
}
@kotlin.jvm.JvmStatic()
@org.jetbrains.annotations.NotNull()
public static final DataStore<Preferences> getPreferencesDataStore() {
return null;
}
@kotlin.Metadata()
public static final class Companion {
private Companion() {
super();
}
@kotlin.jvm.JvmStatic()
@org.jetbrains.annotations.NotNull()
public final Application get() {
return null;
}
@kotlin.jvm.JvmStatic()
@org.jetbrains.annotations.NotNull()
public final DataStore<Preferences> getPreferencesDataStore() {
return null;
}
}
}
@@ -0,0 +1,45 @@
@kotlin.Metadata()
public final class Foo {
@org.jetbrains.annotations.NotNull()
private final kotlin.Lazy<java.lang.Runnable> foo$delegate = null;
@org.jetbrains.annotations.NotNull()
private final kotlin.Lazy<java.lang.Object> bar$delegate = null;
@org.jetbrains.annotations.NotNull()
private final kotlin.Lazy<java.lang.Object> baz$delegate = null;
@org.jetbrains.annotations.NotNull()
private final kotlin.Lazy<GenericIntf<java.lang.CharSequence>> generic1$delegate = null;
public Foo() {
super();
}
private final java.lang.Runnable getFoo() {
return null;
}
private final java.lang.Object getBar() {
return null;
}
private final java.lang.Object getBaz() {
return null;
}
private final GenericIntf<java.lang.CharSequence> getGeneric1() {
return null;
}
}
////////////////////
@kotlin.Metadata()
public abstract interface GenericIntf<T extends java.lang.Object> {
}
////////////////////
@kotlin.Metadata()
public abstract interface Intf {
}
@@ -1,3 +1,4 @@
// FIR_BLOCKED: LC don't support names with $
// CORRECT_ERROR_TYPES
// FILE: $Test.java
@@ -1,3 +1,4 @@
// FIR_BLOCKED: LC don't support names with $
// CORRECT_ERROR_TYPES
// FILE: te/st/a/JavaClass.java
@@ -0,0 +1,12 @@
@kotlin.Metadata()
public final class Test {
public Test() {
super();
}
public final void a(@org.jetbrains.annotations.NotNull()
ABC a, @org.jetbrains.annotations.NotNull()
BCD b) {
}
}
@@ -0,0 +1,30 @@
@kotlin.Metadata()
public abstract class Cls {
public Cls() {
super();
}
public abstract void foo(@org.jetbrains.annotations.NotNull()
java.lang.String abc);
@org.jetbrains.annotations.NotNull()
public final java.lang.String bar(int bcd) {
return null;
}
}
////////////////////
@kotlin.Metadata()
public abstract interface Intf {
public abstract void foo(@org.jetbrains.annotations.NotNull()
java.lang.String abc);
@org.jetbrains.annotations.NotNull()
public default java.lang.String bar(int bcd) {
return null;
}
}
@@ -0,0 +1,189 @@
package modifiers;
@kotlin.Metadata()
public final class InternalClass {
public InternalClass() {
super();
}
}
////////////////////
package modifiers;
@kotlin.Metadata()
public abstract interface InternalInterface {
}
////////////////////
package modifiers;
@kotlin.Metadata()
public final class Modifiers {
@kotlin.jvm.Transient()
@org.jetbrains.annotations.NotNull()
private final transient java.lang.String transientField = "";
@kotlin.jvm.Volatile()
@org.jetbrains.annotations.NotNull()
private volatile java.lang.String volatileField = "";
public Modifiers() {
super();
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getTransientField() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getVolatileField() {
return null;
}
public final void setVolatileField(@org.jetbrains.annotations.NotNull()
java.lang.String p0) {
}
@kotlin.jvm.Strictfp()
public final strictfp void strictFp() {
}
@kotlin.jvm.JvmOverloads()
@org.jetbrains.annotations.NotNull()
public final java.lang.String overloads() {
return null;
}
@kotlin.jvm.JvmOverloads()
@org.jetbrains.annotations.NotNull()
public final java.lang.String overloads(@org.jetbrains.annotations.NotNull()
java.lang.String a) {
return null;
}
@kotlin.jvm.JvmOverloads()
@org.jetbrains.annotations.NotNull()
public final java.lang.String overloads(@org.jetbrains.annotations.NotNull()
java.lang.String a, int n) {
return null;
}
}
////////////////////
package modifiers;
@kotlin.Metadata()
final class PrivateClass {
public PrivateClass() {
super();
}
}
////////////////////
package modifiers;
@kotlin.Metadata()
abstract interface PrivateInterface {
}
////////////////////
package modifiers;
@kotlin.Metadata()
public final class PublicClass {
public PublicClass() {
super();
}
}
////////////////////
package modifiers;
@kotlin.Metadata()
public abstract class PublicClassPrivateConstructor {
private PublicClassPrivateConstructor() {
super();
}
}
////////////////////
package modifiers;
@kotlin.Metadata()
public class PublicClassProtectedConstructor {
protected PublicClassProtectedConstructor() {
super();
}
@kotlin.Metadata()
protected static abstract interface ProtectedInterface {
}
@kotlin.Metadata()
private static abstract interface PrivateInterface {
}
}
////////////////////
package modifiers;
@kotlin.Metadata()
public abstract interface PublicInterface {
}
////////////////////
package modifiers;
@kotlin.Metadata()
public abstract class SealedClass {
protected SealedClass() {
super();
}
@kotlin.Metadata()
public static final class One extends modifiers.SealedClass {
public One() {
super();
}
}
@kotlin.Metadata()
public static class Two extends modifiers.SealedClass {
public Two() {
super();
}
}
@kotlin.Metadata()
public static abstract class Three extends modifiers.SealedClass.Two {
public Three() {
super();
}
}
@kotlin.Metadata()
public static final class Four extends modifiers.SealedClass.Three {
public Four() {
super();
}
}
}
@@ -0,0 +1,40 @@
@kotlin.Metadata()
public final class AnotherRootClass {
public AnotherRootClass() {
super();
}
}
////////////////////
@kotlin.Metadata()
public final class RootClass {
public RootClass() {
super();
}
}
////////////////////
package test;
@kotlin.Metadata()
public final class M1 {
public M1() {
super();
}
@org.jetbrains.annotations.Nullable()
public static final AnotherRootClass bar() {
return null;
}
@org.jetbrains.annotations.Nullable()
public static final RootClass foo() {
return null;
}
}
@@ -0,0 +1,30 @@
// STRICT
// EXPECTED_ERROR: (other:-1:-1) test.M1: Can't reference type 'RootClass' from default package in Java stub.
// EXPECTED_ERROR_K2: (other:-1:-1) test.M1: Can't reference type 'AnotherRootClass' from default package in Java stub.
// FILE: a.kt
class RootClass
class AnotherRootClass
// FILE: test/b.kt
@file:JvmMultifileClass
@file:JvmName("M1")
package test
import RootClass
fun foo(): RootClass? = null
// FILE: test/c.kt
@file:JvmMultifileClass
@file:JvmName("M1")
package test
import AnotherRootClass
fun bar(): AnotherRootClass? = null
@@ -0,0 +1,40 @@
@kotlin.Metadata()
public final class AnotherRootClass {
public AnotherRootClass() {
super();
}
}
////////////////////
@kotlin.Metadata()
public final class RootClass {
public RootClass() {
super();
}
}
////////////////////
package test;
@kotlin.Metadata()
public final class M1 {
public M1() {
super();
}
@org.jetbrains.annotations.Nullable()
public static final RootClass foo() {
return null;
}
@org.jetbrains.annotations.Nullable()
public static final AnotherRootClass bar() {
return null;
}
}
@@ -0,0 +1,163 @@
@kotlin.Metadata()
public final class A {
@org.jetbrains.annotations.Nullable()
private final A x = null;
public A() {
super();
}
@org.jetbrains.annotations.Nullable()
public final A getX() {
return null;
}
@org.jetbrains.annotations.Nullable()
public final A f1(@org.jetbrains.annotations.NotNull()
A a, @org.jetbrains.annotations.NotNull()
A.B b) {
return null;
}
@kotlin.Metadata()
public static abstract interface B {
@org.jetbrains.annotations.Nullable()
public abstract A.B getY();
}
@kotlin.Metadata()
public static final class C {
@org.jetbrains.annotations.NotNull()
public static final A.C INSTANCE = null;
private C() {
super();
}
}
}
////////////////////
@kotlin.Metadata()
public final class A2 {
public A2() {
super();
}
@kotlin.Metadata()
public static final class B {
public B() {
super();
}
@kotlin.Metadata()
public static final class C {
public C() {
super();
}
@kotlin.Metadata()
public static final class D {
public D() {
super();
}
@kotlin.Metadata()
public static final class Cme {
public Cme() {
super();
}
}
@kotlin.Metadata()
public static final class E {
public E() {
super();
}
}
}
}
}
}
////////////////////
@kotlin.Metadata()
public final class Foo {
public Foo() {
super();
}
}
////////////////////
@kotlin.Metadata()
public final class Test {
public Test() {
super();
}
@kotlin.Metadata()
public static final class Nested {
public Nested() {
super();
}
@kotlin.Metadata()
public static final class NestedNested {
public NestedNested() {
super();
}
}
}
@kotlin.Metadata()
public final class Inner {
public Inner() {
super();
}
}
@kotlin.Metadata()
public static final class NestedObject {
@org.jetbrains.annotations.NotNull()
public static final Test.NestedObject INSTANCE = null;
private NestedObject() {
super();
}
}
@kotlin.Metadata()
public static abstract interface NestedInterface {
}
@kotlin.Metadata()
public static enum NestedEnum {
/*public static final*/ BLACK /* = new NestedEnum() */,
/*public static final*/ WHITE /* = new NestedEnum() */;
NestedEnum() {
}
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<Test.NestedEnum> getEntries() {
return null;
}
}
}
@@ -1,3 +1,4 @@
// FIR_BLOCKED: LC don't support names with $
// EXPECTED_ERROR: class J$B is public, should be declared in a file named J$B.java
// EXPECTED_ERROR: class JavaClass is public, should be declared in a file named JavaClass.java
@@ -1,3 +1,4 @@
// FIR_BLOCKED: LC don't support names with $
// EXPECTED_ERROR: class J$B is public, should be declared in a file named J$B.java
// FILE: test/JavaClass.java
@@ -0,0 +1,56 @@
@kotlin.Metadata()
@kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"})
public final class NonExistentType {
@org.jetbrains.annotations.NotNull()
public static final NonExistentType INSTANCE = null;
@org.jetbrains.annotations.NotNull()
private static final ABCDEF a = null;
@org.jetbrains.annotations.Nullable()
private static final java.util.List<ABCDEF> b = null;
@org.jetbrains.annotations.NotNull()
private static final kotlin.jvm.functions.Function1<ABCDEF, kotlin.Unit> c = null;
@org.jetbrains.annotations.NotNull()
private static final ABCDEF<java.lang.String, kotlin.jvm.functions.Function1<java.util.List<? extends ABCDEF>, kotlin.Unit>> d = null;
private NonExistentType() {
super();
}
@org.jetbrains.annotations.NotNull()
public final ABCDEF getA() {
return null;
}
@org.jetbrains.annotations.Nullable()
public final java.util.List<ABCDEF> getB() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final kotlin.jvm.functions.Function1<ABCDEF, kotlin.Unit> getC() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final ABCDEF<java.lang.String, kotlin.jvm.functions.Function1<java.util.List<? extends ABCDEF>, kotlin.Unit>> getD() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final Foo getFoo() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final ABCDEF a(@org.jetbrains.annotations.NotNull()
ABCDEF a, @org.jetbrains.annotations.NotNull()
java.lang.String s) {
return null;
}
@org.jetbrains.annotations.NotNull()
public final ABCDEF b(@org.jetbrains.annotations.NotNull()
java.lang.String s) {
return null;
}
}
@@ -1,7 +1,9 @@
// FIR_BLOCKED: KT-59698
// CORRECT_ERROR_TYPES
// NON_EXISTENT_CLASS
// NO_VALIDATION
// WITH_STDLIB
// FULL_JDK
@file:Suppress("UNRESOLVED_REFERENCE", "ANNOTATION_ARGUMENT_MUST_BE_CONST", "NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION", "UNSUPPORTED_FEATURE")
import java.util.Calendar
@@ -0,0 +1,118 @@
@kotlin.Metadata()
@kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"})
public final class NonExistentClassWIthoutCorrectionKt {
}
////////////////////
@kotlin.Metadata()
public final class NonExistentType {
@org.jetbrains.annotations.NotNull()
public static final NonExistentType INSTANCE = null;
@org.jetbrains.annotations.NotNull()
private static final ABCDEF a = null;
@org.jetbrains.annotations.Nullable()
private static final java.util.List<ABCDEF> b = null;
@org.jetbrains.annotations.NotNull()
private static final kotlin.jvm.functions.Function1<ABCDEF, kotlin.Unit> c = null;
@org.jetbrains.annotations.NotNull()
private static final ABCDEF<java.lang.String, kotlin.jvm.functions.Function1<java.util.List<? extends ABCDEF>, kotlin.Unit>> d = null;
public static java.lang.String string2;
public static ABC coocoo;
public static ABC<java.lang.String> coocoo2;
public static ABC<ABC> coocoo21;
public static ABC<java.lang.String, java.lang.String> coocoo3;
public static ABC<java.lang.String, ABC<ABC>> coocoo31;
private NonExistentType() {
super();
}
@org.jetbrains.annotations.NotNull()
public final ABCDEF getA() {
return null;
}
@org.jetbrains.annotations.Nullable()
public final java.util.List<ABCDEF> getB() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final kotlin.jvm.functions.Function1<ABCDEF, kotlin.Unit> getC() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final ABCDEF<java.lang.String, kotlin.jvm.functions.Function1<java.util.List<? extends ABCDEF>, kotlin.Unit>> getD() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getString2() {
return null;
}
public final void setString2(@org.jetbrains.annotations.NotNull()
java.lang.String p0) {
}
@org.jetbrains.annotations.NotNull()
public final ABC getCoocoo() {
return null;
}
public final void setCoocoo(@org.jetbrains.annotations.NotNull()
ABC p0) {
}
@org.jetbrains.annotations.NotNull()
public final ABC<java.lang.String> getCoocoo2() {
return null;
}
public final void setCoocoo2(@org.jetbrains.annotations.NotNull()
ABC<java.lang.String> p0) {
}
@org.jetbrains.annotations.NotNull()
public final ABC<ABC> getCoocoo21() {
return null;
}
public final void setCoocoo21(@org.jetbrains.annotations.NotNull()
ABC<ABC> p0) {
}
@org.jetbrains.annotations.NotNull()
public final ABC<java.lang.String, java.lang.String> getCoocoo3() {
return null;
}
public final void setCoocoo3(@org.jetbrains.annotations.NotNull()
ABC<java.lang.String, java.lang.String> p0) {
}
@org.jetbrains.annotations.NotNull()
public final ABC<java.lang.String, ABC<ABC>> getCoocoo31() {
return null;
}
public final void setCoocoo31(@org.jetbrains.annotations.NotNull()
ABC<java.lang.String, ABC<ABC>> p0) {
}
@org.jetbrains.annotations.NotNull()
public final ABCDEF a(@org.jetbrains.annotations.NotNull()
ABCDEF a, @org.jetbrains.annotations.NotNull()
java.lang.String s) {
return null;
}
@org.jetbrains.annotations.NotNull()
public final ABCDEF b(@org.jetbrains.annotations.NotNull()
java.lang.String s) {
return null;
}
}
@@ -0,0 +1,75 @@
@kotlin.Metadata()
public final class PrimitiveTypes {
@org.jetbrains.annotations.NotNull()
public static final PrimitiveTypes INSTANCE = null;
public static final boolean booleanFalse = false;
public static final boolean booleanTrue = true;
public static final int int0 = 0;
public static final int intMinus1000 = -1000;
public static final int intMinValue = -2147483648;
public static final int intMaxValue = 2147483647;
public static final int intHex = -1;
public static final byte byte0 = (byte)0;
public static final byte byte50 = (byte)50;
public static final short short5 = (short)5;
public static final char charC = 'C';
public static final char char0 = '\u0000';
public static final char char10 = '\n';
public static final char char13 = '\r';
public static final long long0 = 0L;
public static final long longMaxValue = 9223372036854775807L;
public static final long longMinValue = -9223372036854775808L;
public static final long longHex = 4294967295L;
public static final float float54 = 5.4F;
private static final float floatMaxValue = 3.4028235E38F;
private static final float floatNan = 0.0F / 0.0F;
private static final float floatPositiveInfinity = 1.0F / 0.0F;
private static final float floatNegativeInfinity = -1.0F / 0.0F;
public static final double double54 = 5.4;
private static final double doubleMaxValue = 1.7976931348623157E308;
private static final double doubleNan = 0.0 / 0.0;
private static final double doublePositiveInfinity = 1.0 / 0.0;
private static final double doubleNegativeInfinity = -1.0 / 0.0;
@org.jetbrains.annotations.NotNull()
public static final java.lang.String stringHelloWorld = "Hello, world!";
@org.jetbrains.annotations.NotNull()
public static final java.lang.String stringQuotes = "quotes \" \'\'quotes";
@org.jetbrains.annotations.NotNull()
public static final java.lang.String stringRN = "\r\n";
private PrimitiveTypes() {
super();
}
public final float getFloatMaxValue() {
return 0.0F;
}
public final float getFloatNan() {
return 0.0F;
}
public final float getFloatPositiveInfinity() {
return 0.0F;
}
public final float getFloatNegativeInfinity() {
return 0.0F;
}
public final double getDoubleMaxValue() {
return 0.0;
}
public final double getDoubleNan() {
return 0.0;
}
public final double getDoublePositiveInfinity() {
return 0.0;
}
public final double getDoubleNegativeInfinity() {
return 0.0;
}
}
@@ -0,0 +1,38 @@
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface Anno {
}
////////////////////
@kotlin.Metadata()
@kotlin.annotation.Target(allowedTargets = {kotlin.annotation.AnnotationTarget.PROPERTY, kotlin.annotation.AnnotationTarget.CLASS})
@java.lang.annotation.Target(value = {java.lang.annotation.ElementType.TYPE})
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface Anno2 {
}
////////////////////
@kotlin.Metadata()
public final class Test {
@org.jetbrains.annotations.NotNull()
private final java.lang.String prop = "A";
public Test() {
super();
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getProp() {
return null;
}
@Anno()
@Anno2()
@java.lang.Deprecated()
public static void getProp$annotations() {
}
}
@@ -0,0 +1,44 @@
package androidx.annotation;
public interface Box {
@RecentlyNullable()
public String foo();
}
////////////////////
package androidx.annotation;
import java.lang.annotation.*;
@Retention(value = RetentionPolicy.CLASS)
@Target(value = {ElementType.METHOD, ElementType.PARAMETER, ElementType.FIELD})
@interface RecentlyNullable {
}
////////////////////
package app;
@kotlin.Metadata()
public final class KBox implements androidx.annotation.Box {
@org.jetbrains.annotations.NotNull()
private final androidx.annotation.Box delegate = null;
@androidx.annotation.RecentlyNullable()
@java.lang.Override()
public java.lang.String foo() {
return null;
}
public KBox(@org.jetbrains.annotations.NotNull()
androidx.annotation.Box delegate) {
super();
}
@org.jetbrains.annotations.NotNull()
public final androidx.annotation.Box getDelegate() {
return null;
}
}
@@ -0,0 +1,232 @@
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface AnnoArray {
public abstract int x();
public abstract java.lang.String[] a();
}
////////////////////
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface AnnoBoolean {
public abstract int x();
public abstract boolean bool();
}
////////////////////
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface AnnoChar {
public abstract int x();
public abstract char chr();
}
////////////////////
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface AnnoClass {
public abstract int x();
public abstract java.lang.Class<Color> c();
}
////////////////////
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface AnnoDouble {
public abstract int x();
public abstract double dbl();
}
////////////////////
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface AnnoEnum {
public abstract int x();
public abstract Color c();
}
////////////////////
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface AnnoFloat {
public abstract int x();
public abstract float flt();
}
////////////////////
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface AnnoInt {
public abstract int x();
public abstract int i();
}
////////////////////
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface AnnoIntArray {
public abstract int x();
public abstract int[] b();
}
////////////////////
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface AnnoLong {
public abstract int x();
public abstract long l();
}
////////////////////
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface AnnoLongArray {
public abstract int x();
public abstract long[] b();
}
////////////////////
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface AnnoString {
public abstract int x();
public abstract java.lang.String s();
}
////////////////////
@kotlin.Metadata()
public enum Color {
/*public static final*/ BLACK /* = new Color() */;
Color() {
}
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<Color> getEntries() {
return null;
}
}
////////////////////
@kotlin.Metadata()
public final class Test {
@org.jetbrains.annotations.NotNull()
private final java.lang.String value = "";
public Test() {
super();
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getValue() {
return null;
}
@lib.Anno(value = "1")
@lib.Anno(value = "2", construct = {"A", "B"})
@lib.Anno(value = "3", construct = {"C"})
@java.lang.Deprecated()
public static void getValue$annotations() {
}
}
////////////////////
@kotlin.Metadata()
@AnnoChar(x = 100, chr = 'c')
@AnnoBoolean(x = 100, bool = false)
@AnnoInt(x = 100, i = 5)
@AnnoFloat(x = 100, flt = 1.0F)
@AnnoDouble(x = 100, dbl = 4.0)
@AnnoString(x = 100, s = "AAA")
@AnnoIntArray(x = 100, b = {1, 2, 3})
@AnnoLongArray(x = 100, b = {1L, 3L})
@AnnoArray(x = 100, a = {"A", "B"})
@AnnoClass(x = 100, c = Color.class)
public final class Test2 {
public Test2() {
super();
}
}
////////////////////
package lib;
public @interface Anno {
String[] construct() default {};
String value();
}
////////////////////
package lib;
public class R {
public R() {
super();
}
public static class id {
public id() {
super();
}
public static final int textView = 100;
}
}
@@ -0,0 +1,33 @@
package secondary;
@kotlin.Metadata()
public abstract interface Named {
@org.jetbrains.annotations.Nullable()
public abstract java.lang.String getName();
}
////////////////////
package secondary;
@kotlin.Metadata()
public final class Product2 implements secondary.Named {
@org.jetbrains.annotations.Nullable()
private java.lang.String name = null;
@org.jetbrains.annotations.Nullable()
@java.lang.Override()
public java.lang.String getName() {
return null;
}
public void setName(@org.jetbrains.annotations.Nullable()
java.lang.String p0) {
}
public Product2(@org.jetbrains.annotations.NotNull()
java.lang.String otherName) {
super();
}
}
@@ -0,0 +1,43 @@
@kotlin.Metadata()
public final class ResolvedKt {
public ResolvedKt() {
super();
}
@org.jetbrains.annotations.Nullable()
private static kotlin.io.encoding.Base64 base64 = null;
@org.jetbrains.annotations.Nullable()
public static final kotlin.io.encoding.Base64 getBase64() {
return null;
}
public static final void setBase64(@org.jetbrains.annotations.Nullable()
kotlin.io.encoding.Base64 p0) {
}
}
////////////////////
import kotlin.io.encoding.*;
@kotlin.Metadata()
@kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"})
public final class UnresolvedKt {
public UnresolvedKt() {
super();
}
@org.jetbrains.annotations.NotNull()
private static Base65 base65 = null;
@org.jetbrains.annotations.NotNull()
public static final Base65 getBase65() {
return null;
}
public static final void setBase65(@org.jetbrains.annotations.NotNull()
Base65 p0) {
}
}
@@ -0,0 +1,11 @@
// CORRECT_ERROR_TYPES
// FILE: resolved.kt
import kotlin.io.encoding.*
var base64: Base64? = null
// FILE: unresolved.kt
@file:Suppress("UNRESOLVED_REFERENCE")
import kotlin.io.encoding.*
var base65: Base65? = null
@@ -0,0 +1,45 @@
import kotlin.io.encoding.*;
@kotlin.Metadata()
public final class ResolvedKt {
public ResolvedKt() {
super();
}
@org.jetbrains.annotations.Nullable()
private static kotlin.io.encoding.Base64 base64;
@org.jetbrains.annotations.Nullable()
public static final kotlin.io.encoding.Base64 getBase64() {
return null;
}
public static final void setBase64(@org.jetbrains.annotations.Nullable()
kotlin.io.encoding.Base64 p0) {
}
}
////////////////////
import kotlin.io.encoding.*;
@kotlin.Metadata()
@kotlin.Suppress(names = {"UNRESOLVED_REFERENCE"})
public final class UnresolvedKt {
public UnresolvedKt() {
super();
}
@org.jetbrains.annotations.Nullable()
private static Base65 base65;
@org.jetbrains.annotations.Nullable()
public static final Base65 getBase65() {
return null;
}
public static final void setBase65(@org.jetbrains.annotations.Nullable()
Base65 p0) {
}
}
@@ -0,0 +1,62 @@
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface Anno {
public abstract StrangeEnum size();
public abstract java.lang.String name();
}
////////////////////
@kotlin.Metadata()
public enum StrangeEnum {
/*public static final*/ InvalidFieldName /* = new StrangeEnum() */;
@org.jetbrains.annotations.NotNull()
private final java.lang.String size = null;
StrangeEnum(java.lang.String size) {
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getSize() {
return null;
}
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<StrangeEnum> getEntries() {
return null;
}
}
////////////////////
@kotlin.Metadata()
public final class Test {
public final java.lang.String simpleName = null;
public Test() {
super();
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getSimpleName() {
return null;
}
public final void simpleFun() {
}
@Anno(name = "Woofwoof", size = StrangeEnum.InvalidFieldName)
public final void simpleFun2(@org.jetbrains.annotations.NotNull()
java.lang.String a, @org.jetbrains.annotations.NotNull()
java.lang.String b) {
}
public final void strangeFun4(@org.jetbrains.annotations.NotNull()
java.lang.String a, @org.jetbrains.annotations.NotNull()
java.lang.String p1_949560896) {
}
}
@@ -0,0 +1,49 @@
public abstract class BaseClass {
public BaseClass(@org.jetbrains.annotations.NotNull()
Context context, int num, boolean bool) {
super();
}
@org.jetbrains.annotations.NotNull()
public abstract Result doJob();
}
////////////////////
public abstract interface Context {
}
////////////////////
public final class Inheritor extends BaseClass {
public Inheritor(@org.jetbrains.annotations.NotNull()
Context context) {
super(null, 0, false);
}
@org.jetbrains.annotations.NotNull()
@java.lang.Override()
public Result doJob() {
return null;
}
}
////////////////////
public enum Result {
/*public static final*/ SUCCESS /* = new Result() */,
/*public static final*/ ERROR /* = new Result() */;
Result() {
}
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<Result> getEntries() {
return null;
}
}
@@ -0,0 +1,13 @@
@kotlin.Metadata()
public final class Foo {
public Foo() {
super();
}
@org.jetbrains.annotations.Nullable()
public final java.lang.Object a(@org.jetbrains.annotations.NotNull()
kotlin.coroutines.Continuation<? super ABC> $completion) {
return null;
}
}
@@ -0,0 +1,69 @@
package test.another;
@kotlin.Metadata()
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
public abstract @interface Anno {
public abstract java.lang.String value();
}
////////////////////
package test.another;
@kotlin.Metadata()
public final class TopLevelKt {
public TopLevelKt() {
super();
}
public static final int topLevelConstProperty = 2;
private static final int topLevelProperty = 2;
public static final void extensionFunction(@Anno(value = "rec")
@org.jetbrains.annotations.NotNull()
java.lang.String $this$extensionFunction, @Anno(value = "1")
@org.jetbrains.annotations.NotNull()
java.lang.String a, @Anno(value = "2")
@org.jetbrains.annotations.NotNull()
java.lang.String b) {
}
@org.jetbrains.annotations.NotNull()
public static final <T extends java.lang.Object>java.lang.String getExtensionProperty(@Anno(value = "propRec")
@org.jetbrains.annotations.NotNull()
T $this$extensionProperty) {
return null;
}
@Anno(value = "extpr")
@java.lang.Deprecated()
public static void getExtensionProperty$annotations(java.lang.Object p0) {
}
public static final int getTopLevelProperty() {
return 0;
}
@org.jetbrains.annotations.NotNull()
public static final java.lang.String getTopLevelProperty2() {
return null;
}
public static final <T extends java.lang.Object>void setExtensionProperty(@Anno(value = "propRec")
@org.jetbrains.annotations.NotNull()
T $this$extensionProperty, @Anno(value = "setparam")
@org.jetbrains.annotations.NotNull()
java.lang.String setParamName) {
}
@org.jetbrains.annotations.Nullable()
public static final java.lang.String topLevelFunction() {
return null;
}
@org.jetbrains.annotations.Nullable()
public static final <X extends java.lang.CharSequence, T extends java.util.List<? extends X>>T topLevelGenericFunction() {
return null;
}
}
@@ -1,3 +1,5 @@
// WITH_STDLIB
// FULL_JDK
package test.another
annotation class Anno(val value: String)
@@ -0,0 +1,233 @@
@kotlin.Metadata()
public final class Boo {
@org.jetbrains.annotations.NotNull()
public static final Boo INSTANCE = null;
@org.jetbrains.annotations.NotNull()
private static final java.lang.String z = null;
private Boo() {
super();
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getZ() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String foo() {
return null;
}
}
////////////////////
@kotlin.Metadata()
public final class Foo {
@org.jetbrains.annotations.NotNull()
public static final Foo INSTANCE = null;
@org.jetbrains.annotations.NotNull()
public static final java.lang.String aString = "foo";
public static final int aInt = 3;
@org.jetbrains.annotations.NotNull()
private static final java.lang.String bString = "bar";
private static final int bInt = 5;
@org.jetbrains.annotations.NotNull()
private static java.lang.String cString = "baz";
private static int cInt = 7;
@org.jetbrains.annotations.NotNull()
private static final java.lang.String d = null;
private static final int e = 0;
private static final int f = 8;
@org.jetbrains.annotations.NotNull()
private static final java.lang.String g = "ab";
private static final int h = -4;
private static final int i = 2147483647;
@org.jetbrains.annotations.NotNull()
private static final java.lang.String j = null;
@org.jetbrains.annotations.NotNull()
private static final java.lang.String k = null;
private Foo() {
super();
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getBString() {
return null;
}
public final int getBInt() {
return 0;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getCString() {
return null;
}
public final void setCString(@org.jetbrains.annotations.NotNull()
java.lang.String p0) {
}
public final int getCInt() {
return 0;
}
public final void setCInt(int p0) {
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getD() {
return null;
}
public final int getE() {
return 0;
}
public final int getF() {
return 0;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getG() {
return null;
}
public final int getH() {
return 0;
}
public final int getI() {
return 0;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getJ() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String getK() {
return null;
}
}
////////////////////
@kotlin.Metadata()
public final class HavingState {
@org.jetbrains.annotations.NotNull()
private final State state = State.START;
@org.jetbrains.annotations.NotNull()
private final State[] stateArray = {State.START};
@org.jetbrains.annotations.NotNull()
private final java.lang.String[] stringArray = {"foo"};
@org.jetbrains.annotations.NotNull()
private final java.util.List<java.lang.String> stringList = null;
@org.jetbrains.annotations.NotNull()
private final java.lang.Integer[] intArray = {1};
@org.jetbrains.annotations.NotNull()
private final float[] floatArray = {-1.0F};
@org.jetbrains.annotations.NotNull()
private final java.util.List<java.lang.Integer> intList = null;
private final int uint = 1;
@org.jetbrains.annotations.NotNull()
private final kotlin.UInt[] uintArray = {1};
@org.jetbrains.annotations.NotNull()
private final java.util.List<kotlin.UInt> uintList = null;
@org.jetbrains.annotations.NotNull()
private final kotlin.reflect.KClass<State> clazz = null;
@org.jetbrains.annotations.NotNull()
private final java.lang.Class<State> javaClass = null;
@org.jetbrains.annotations.NotNull()
private final kotlin.reflect.KClass<? extends java.lang.Object> anonymous = null;
public HavingState() {
super();
}
@org.jetbrains.annotations.NotNull()
public final State getState() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final State[] getStateArray() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.String[] getStringArray() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.util.List<java.lang.String> getStringList() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.Integer[] getIntArray() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final float[] getFloatArray() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.util.List<java.lang.Integer> getIntList() {
return null;
}
public final int getUint() {
return 0;
}
@org.jetbrains.annotations.NotNull()
public final kotlin.UInt[] getUintArray() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.util.List<kotlin.UInt> getUintList() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final kotlin.reflect.KClass<State> getClazz() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final java.lang.Class<State> getJavaClass() {
return null;
}
@org.jetbrains.annotations.NotNull()
public final kotlin.reflect.KClass<? extends java.lang.Object> getAnonymous() {
return null;
}
}
////////////////////
@kotlin.Metadata()
public enum State {
/*public static final*/ START /* = new State() */,
/*public static final*/ FINISH /* = new State() */;
State() {
}
@org.jetbrains.annotations.NotNull()
public static kotlin.enums.EnumEntries<State> getEntries() {
return null;
}
}
@@ -535,6 +535,12 @@ public class ClassFileToSourceStubConverterTestGenerated extends AbstractClassFi
runTest("plugins/kapt3/kapt3-compiler/testData/converter/multifileClass.kt");
}
@Test
@TestMetadata("multifileClassDefaultPackage.kt")
public void testMultifileClassDefaultPackage() throws Exception {
runTest("plugins/kapt3/kapt3-compiler/testData/converter/multifileClassDefaultPackage.kt");
}
@Test
@TestMetadata("nestedClasses.kt")
public void testNestedClasses() throws Exception {
@@ -613,6 +619,12 @@ public class ClassFileToSourceStubConverterTestGenerated extends AbstractClassFi
runTest("plugins/kapt3/kapt3-compiler/testData/converter/severalPackageParts.kt");
}
@Test
@TestMetadata("starImports.kt")
public void testStarImports() throws Exception {
runTest("plugins/kapt3/kapt3-compiler/testData/converter/starImports.kt");
}
@Test
@TestMetadata("strangeIdentifiers.kt")
public void testStrangeIdentifiers() throws Exception {
@@ -535,6 +535,12 @@ public class IrClassFileToSourceStubConverterTestGenerated extends AbstractIrCla
runTest("plugins/kapt3/kapt3-compiler/testData/converter/multifileClass.kt");
}
@Test
@TestMetadata("multifileClassDefaultPackage.kt")
public void testMultifileClassDefaultPackage() throws Exception {
runTest("plugins/kapt3/kapt3-compiler/testData/converter/multifileClassDefaultPackage.kt");
}
@Test
@TestMetadata("nestedClasses.kt")
public void testNestedClasses() throws Exception {
@@ -613,6 +619,12 @@ public class IrClassFileToSourceStubConverterTestGenerated extends AbstractIrCla
runTest("plugins/kapt3/kapt3-compiler/testData/converter/severalPackageParts.kt");
}
@Test
@TestMetadata("starImports.kt")
public void testStarImports() throws Exception {
runTest("plugins/kapt3/kapt3-compiler/testData/converter/starImports.kt");
}
@Test
@TestMetadata("strangeIdentifiers.kt")
public void testStrangeIdentifiers() throws Exception {
+11
View File
@@ -13,6 +13,17 @@ dependencies {
implementation(project(":kotlin-annotation-processing-compiler"))
embedded(project(":kotlin-annotation-processing-compiler")) { isTransitive = false }
implementation(project(":analysis:analysis-api-standalone"))
embedded(project(":analysis:analysis-api-standalone")) {
exclude("org.jetbrains.kotlin", "kotlin-stdlib")
exclude("org.jetbrains.kotlin", "kotlin-stdlib-common")
}
compileOnly(toolsJarApi())
testApiJUnit5()
testApi(projectTests(":kotlin-annotation-processing-compiler"))
testRuntimeOnly(toolsJar())
testRuntimeOnly(commonDependency("org.codehaus.woodstox:stax2-api"))
testRuntimeOnly(commonDependency("com.fasterxml:aalto-xml"))
}
optInToExperimentalCompilerApi()
@@ -0,0 +1,28 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.kapt4
import com.sun.tools.javac.tree.TreeMaker
import com.sun.tools.javac.util.Context
import org.jetbrains.kotlin.analysis.api.KtAnalysisSession
import org.jetbrains.kotlin.asJava.classes.KtLightClass
import org.jetbrains.kotlin.base.kapt3.KaptOptions
import org.jetbrains.kotlin.kapt3.base.KaptContext
import org.jetbrains.kotlin.kapt3.base.util.KaptLogger
internal class Kapt4ContextForStubGeneration(
options: KaptOptions,
withJdk: Boolean,
logger: KaptLogger,
val analysisSession: KtAnalysisSession,
val classes: Iterable<KtLightClass>
) : KaptContext(options, withJdk, logger) {
internal val treeMaker = TreeMaker.instance(context) as Kapt4TreeMaker
override fun preregisterTreeMaker(context: Context) {
Kapt4TreeMaker.preRegister(context)
}
}
@@ -0,0 +1,61 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.kapt4
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiField
import com.intellij.psi.PsiMethod
import com.sun.tools.javac.tree.JCTree
import org.jetbrains.kotlin.asJava.elements.KtLightElement
import org.jetbrains.kotlin.asJava.elements.KtLightMember
import org.jetbrains.kotlin.asJava.elements.KtLightParameter
import org.jetbrains.kotlin.kapt3.stubs.AbstractKDocCommentKeeper
import org.jetbrains.kotlin.psi.*
internal class Kapt4KDocCommentKeeper(context: Kapt4ContextForStubGeneration): AbstractKDocCommentKeeper<Kapt4ContextForStubGeneration>(context) {
fun saveKDocComment(tree: JCTree, psiElement: PsiElement) {
val ktElement = psiElement.extractOriginalKtDeclaration<KtDeclaration>() ?: return
if (psiElement is PsiField && ktElement is KtObjectDeclaration) {
// Do not write KDoc on object instance field
return
}
val docComment =
when {
ktElement is KtProperty -> ktElement.docComment
ktElement.docComment == null && ktElement is KtPropertyAccessor -> ktElement.property.docComment
else -> ktElement.docComment
} ?: return
if (psiElement is PsiMethod && psiElement.isConstructor && ktElement is KtClassOrObject) {
// We don't want the class comment to be duplicated on <init>()
return
}
saveKDocComment(tree, docComment)
}
}
inline fun <reified T : KtDeclaration> PsiElement.extractOriginalKtDeclaration(): T? {
// This when is needed to avoid recursion
val elementToExtract = when (this) {
is KtLightParameter -> when (kotlinOrigin) {
null -> method
else -> return kotlinOrigin as? T
}
else -> this
}
return when (elementToExtract) {
is KtLightMember<*> -> {
val origin = elementToExtract.lightMemberOrigin
origin?.auxiliaryOriginalElement ?: origin?.originalElement ?: elementToExtract.kotlinOrigin
}
is KtLightElement<*, *> -> elementToExtract.kotlinOrigin
else -> null
} as? T
}
@@ -0,0 +1,50 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.kapt4
import com.intellij.psi.*
import com.sun.tools.javac.tree.JCTree
import org.jetbrains.kotlin.asJava.elements.KtLightElement
import org.jetbrains.kotlin.kapt3.base.stubs.KotlinPosition
import org.jetbrains.kotlin.kapt3.base.stubs.getJavacSignature
import org.jetbrains.kotlin.kapt3.stubs.KaptLineMappingCollectorBase
internal class Kapt4LineMappingCollector: KaptLineMappingCollectorBase() {
fun registerClass(lightClass: PsiClass) {
register(lightClass, lightClass.qualifiedNameWithSlashes)
}
fun registerMethod(lightClass: PsiClass, method: PsiMethod) {
register(method, lightClass.qualifiedNameWithSlashes + "#" + method.name + method.signature)
}
fun registerField(lightClass: PsiClass, field: PsiField) {
register(field, lightClass.qualifiedNameWithSlashes + "#" + field.name)
}
fun registerSignature(declaration: JCTree.JCMethodDecl, method: PsiMethod) {
signatureInfo[declaration.getJavacSignature()] = method.name + method.signature
}
fun getPosition(lightClass: PsiClass): KotlinPosition? {
return lineInfo[lightClass.qualifiedNameWithSlashes]
}
fun getPosition(lightClass: PsiClass, method: PsiMethod): KotlinPosition? =
lineInfo[lightClass.qualifiedNameWithSlashes + "#" + method.name + method.signature]
fun getPosition(lightClass: PsiClass, field: PsiField): KotlinPosition? {
return lineInfo[lightClass.qualifiedNameWithSlashes + "#" + field.name]
}
private fun register(asmNode: Any, fqName: String) {
val psiElement = (asmNode as? KtLightElement<*, *>)?.kotlinOrigin ?: return
register(fqName, psiElement)
}
private val PsiClass.qualifiedNameWithSlashes: String
get() = qualifiedNameWithDollars?.replace(".", "/") ?: "<no name provided>"
}
@@ -0,0 +1,913 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@file:Suppress("UnstableApiUsage")
package org.jetbrains.kotlin.kapt4
import com.intellij.psi.*
import com.sun.tools.javac.code.Flags
import com.sun.tools.javac.code.TypeTag
import com.sun.tools.javac.parser.Tokens
import com.sun.tools.javac.tree.JCTree
import com.sun.tools.javac.tree.JCTree.*
import kotlinx.kapt.KaptIgnored
import org.jetbrains.kotlin.analysis.api.symbols.KtCallableSymbol
import org.jetbrains.kotlin.analysis.api.symbols.KtClassOrObjectSymbol
import org.jetbrains.kotlin.analysis.api.symbols.KtEnumEntrySymbol
import org.jetbrains.kotlin.asJava.classes.KtLightClass
import org.jetbrains.kotlin.asJava.classes.KtLightClassForFacade
import org.jetbrains.kotlin.asJava.elements.KtLightElementBase
import org.jetbrains.kotlin.base.kapt3.KaptFlag
import org.jetbrains.kotlin.builtins.StandardNames
import org.jetbrains.kotlin.idea.references.KtReference
import org.jetbrains.kotlin.kapt3.base.javac.kaptError
import org.jetbrains.kotlin.kapt3.base.javac.reportKaptError
import org.jetbrains.kotlin.kapt3.base.stubs.KaptStubLineInformation
import org.jetbrains.kotlin.kapt3.base.util.TopLevelJava9Aware
import org.jetbrains.kotlin.kapt3.stubs.MemberData
import org.jetbrains.kotlin.kapt3.stubs.MembersPositionComparator
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.SpecialNames
import org.jetbrains.kotlin.name.isOneSegmentFQN
import org.jetbrains.kotlin.psi.KtDotQualifiedExpression
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.psi.KtNameReferenceExpression
import org.jetbrains.kotlin.psi.KtParameter
import org.jetbrains.kotlin.resolve.calls.util.getCalleeExpressionIfAny
import org.jetbrains.kotlin.utils.addToStdlib.runIf
import org.jetbrains.kotlin.utils.addToStdlib.runUnless
import org.jetbrains.org.objectweb.asm.Opcodes
import org.jetbrains.org.objectweb.asm.Type
import java.io.File
import javax.lang.model.element.ElementKind
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract
import kotlin.math.sign
context(Kapt4ContextForStubGeneration)
internal class Kapt4StubGenerator {
private companion object {
private const val VISIBILITY_MODIFIERS = (Opcodes.ACC_PUBLIC or Opcodes.ACC_PRIVATE or Opcodes.ACC_PROTECTED).toLong()
private const val MODALITY_MODIFIERS = (Opcodes.ACC_FINAL or Opcodes.ACC_ABSTRACT).toLong()
private const val CLASS_MODIFIERS = VISIBILITY_MODIFIERS or MODALITY_MODIFIERS or
(Opcodes.ACC_DEPRECATED or Opcodes.ACC_INTERFACE or Opcodes.ACC_ANNOTATION or Opcodes.ACC_ENUM or Opcodes.ACC_STATIC).toLong()
private const val METHOD_MODIFIERS = VISIBILITY_MODIFIERS or MODALITY_MODIFIERS or
(Opcodes.ACC_DEPRECATED or Opcodes.ACC_SYNCHRONIZED or Opcodes.ACC_NATIVE or Opcodes.ACC_STATIC or Opcodes.ACC_STRICT).toLong()
private const val FIELD_MODIFIERS = VISIBILITY_MODIFIERS or MODALITY_MODIFIERS or
(Opcodes.ACC_VOLATILE or Opcodes.ACC_TRANSIENT or Opcodes.ACC_ENUM or Opcodes.ACC_STATIC).toLong()
private const val PARAMETER_MODIFIERS = FIELD_MODIFIERS or Flags.PARAMETER or Flags.VARARGS or Opcodes.ACC_FINAL.toLong()
private val BLACKLISTED_ANNOTATIONS = listOf(
"java.lang.Synthetic",
"synthetic.kotlin.jvm.GeneratedByJvmOverloads" // kapt3-related annotation for marking JvmOverloads-generated methods
)
private val KOTLIN_METADATA_ANNOTATION = Metadata::class.java.name
private val JAVA_KEYWORD_FILTER_REGEX = "[a-z]+".toRegex()
@Suppress("UselessCallOnNotNull") // nullable toString(), KT-27724
private val JAVA_KEYWORDS = Tokens.TokenKind.values()
.filter { JAVA_KEYWORD_FILTER_REGEX.matches(it.toString().orEmpty()) }
.mapTo(hashSetOf(), Any::toString)
}
private val strictMode = options[KaptFlag.STRICT]
private val stripMetadata = options[KaptFlag.STRIP_METADATA]
private val keepKdocComments = options[KaptFlag.KEEP_KDOC_COMMENTS_IN_STUBS]
private val dumpDefaultParameterValues = options[KaptFlag.DUMP_DEFAULT_PARAMETER_VALUES]
private val kdocCommentKeeper = runIf(keepKdocComments) { Kapt4KDocCommentKeeper(this@Kapt4ContextForStubGeneration) }
internal fun generateStubs(): Map<KtLightClass, KaptStub?> {
return classes.associateWith { convertTopLevelClass(it) }
}
private fun convertTopLevelClass(lightClass: KtLightClass): KaptStub? {
val ktFiles = when(lightClass) {
is KtLightClassForFacade -> lightClass.files
else -> listOfNotNull(lightClass.kotlinOrigin?.containingKtFile)
}
val lineMappings = Kapt4LineMappingCollector()
val packageName = (lightClass.parent as? PsiJavaFile)?.packageName ?: return null
val packageClause = runUnless(packageName.isBlank()) { treeMaker.FqName(packageName) }
val unresolvedQualifiersRecorder = UnresolvedQualifiersRecorder(ktFiles)
val classDeclaration = with(unresolvedQualifiersRecorder) {
convertClass(lightClass, lineMappings, packageName) ?: return null
}
val classes = JavacList.of<JCTree>(classDeclaration)
// imports should be collected after class conversion to
val imports = ktFiles.fold(JavacList.nil<JCTree>()) { acc, file ->
acc.appendList(convertImports(file, unresolvedQualifiersRecorder))
}
val topLevel = treeMaker.TopLevelJava9Aware(packageClause, imports + classes)
if (kdocCommentKeeper != null) {
topLevel.docComments = kdocCommentKeeper.getDocTable(topLevel)
}
return KaptStub(topLevel, lineMappings.serialize())
}
context(UnresolvedQualifiersRecorder)
private fun convertClass(
lightClass: PsiClass,
lineMappings: Kapt4LineMappingCollector,
packageFqName: String
): JCClassDecl? {
if (!checkIfValidTypeName(lightClass, lightClass.defaultType)) return null
val parentClass = lightClass.parent as? PsiClass
val flags = if ((parentClass?.isInterface == true || parentClass?.isAnnotationType == true) && !lightClass.isPublic)
(lightClass.accessFlags and Flags.PRIVATE.toLong().inv()) else lightClass.accessFlags
val metadata = calculateMetadata(lightClass)
val isEnum = lightClass.isEnum
val modifiers = convertModifiers(
lightClass,
flags,
if (isEnum) ElementKind.ENUM else ElementKind.CLASS,
packageFqName,
lightClass.annotations.toList(),
metadata,
)
val simpleName = lightClass.name!!
if (!isValidIdentifier(simpleName)) return null
val classSignature = parseClassSignature(lightClass)
val enumValues: JavacList<JCTree> = mapJList(lightClass.fields) { field ->
if (field !is PsiEnumConstant) return@mapJList null
val constructorArguments = lightClass.constructors.firstOrNull()?.parameters?.mapNotNull { it.type as? PsiType }.orEmpty()
val args = mapJList(constructorArguments) { convertLiteralExpression(getDefaultValue(it)) }
convertField(
field, lightClass, lineMappings, packageFqName, treeMaker.NewClass(
/* enclosing = */ null,
/* typeArgs = */ JavacList.nil(),
/* lightClass = */ treeMaker.Ident(treeMaker.name(field.name)),
/* args = */ args,
/* def = */ null
)
)
}
val fieldsPositions = mutableMapOf<JCTree, MemberData>()
val fields = mapJList<PsiField, JCTree>(lightClass.fields) { field ->
runUnless(field is PsiEnumConstant) { convertField(field, lightClass, lineMappings, packageFqName)?.also {
fieldsPositions[it] = MemberData(field.name, field.signature, lineMappings.getPosition(lightClass, field))
}
}
}
val methodsPositions = mutableMapOf<JCTree, MemberData>()
val methods = mapJList<PsiMethod, JCTree>(lightClass.methods) { method ->
if (isEnum && method.isSyntheticStaticEnumMethod()) {
return@mapJList null
}
convertMethod(method, lightClass, lineMappings, packageFqName)?.also {
methodsPositions[it] = MemberData(method.name, method.signature, lineMappings.getPosition(lightClass, method))
}
}
val nestedClasses = mapJList(lightClass.innerClasses) { innerClass ->
convertClass(innerClass, lineMappings, packageFqName)
}
lineMappings.registerClass(lightClass)
val classPosition = lineMappings.getPosition(lightClass)
val sortedFields = JavacList.from(fields.sortedWith(MembersPositionComparator(classPosition, fieldsPositions)))
val sortedMethods = JavacList.from(methods.sortedWith(MembersPositionComparator(classPosition, methodsPositions)))
return treeMaker.ClassDef(
modifiers,
treeMaker.name(simpleName),
classSignature.typeParameters,
classSignature.superClass.takeUnless { classSignature.superClassIsObject || lightClass.isEnum },
classSignature.interfaces,
JavacList.from(enumValues + sortedFields + sortedMethods + nestedClasses)
).keepKdocCommentsIfNecessary(lightClass)
}
private fun PsiMethod.isSyntheticStaticEnumMethod(): Boolean {
if (!this.isStatic) return false
return when (name) {
StandardNames.ENUM_VALUES.asString() -> parameters.isEmpty()
StandardNames.ENUM_VALUE_OF.asString() -> (parameters.singleOrNull()?.type as? PsiClassType)?.qualifiedName == "java.lang.String"
else -> false
}
}
private fun convertImports(file: KtFile, unresolvedQualifiers: UnresolvedQualifiersRecorder): JavacList<JCTree> {
if (unresolvedQualifiers.isEmpty()) return JavacList.nil()
val imports = mutableListOf<JCImport>()
val importedShortNames = mutableSetOf<String>()
// We prefer ordinary imports over aliased ones.
val sortedImportDirectives = file.importDirectives.partition { it.aliasName == null }.run { first + second }
loop@ for (importDirective in sortedImportDirectives) {
val acceptableByName = when {
importDirective.isAllUnder -> unresolvedQualifiers.simpleNames.isNotEmpty()
else -> {
val fqName = importDirective.importedFqName ?: continue
fqName.asString() in unresolvedQualifiers.qualifiedNames || fqName.shortName().identifier in unresolvedQualifiers.simpleNames
}
}
if (!acceptableByName) continue
val importedSymbols = with(analysisSession) {
val importedReference = importDirective.importedReference
?.getCalleeExpressionIfAny()
?.references
?.firstOrNull() as? KtReference
importedReference?.resolveToSymbols().orEmpty()
}
val isAllUnderClassifierImport = importDirective.isAllUnder && importedSymbols.any { it is KtClassOrObjectSymbol }
val isCallableImport = !importDirective.isAllUnder && importedSymbols.any { it is KtCallableSymbol }
val isEnumEntryImport = !importDirective.isAllUnder && importedSymbols.any { it is KtEnumEntrySymbol }
if (isAllUnderClassifierImport || isCallableImport || isEnumEntryImport) continue
// Qualified name should be valid Java fq-name
val importedFqName = importDirective.importedFqName?.takeIf { it.pathSegments().size > 1 } ?: continue
if (!isValidQualifiedName(importedFqName)) continue
val importedExpr = treeMaker.FqName(importedFqName.asString())
imports += if (importDirective.isAllUnder) {
treeMaker.Import(treeMaker.Select(importedExpr, treeMaker.nameTable.names.asterisk), false)
} else {
if (!importedShortNames.add(importedFqName.shortName().asString())) {
continue
}
treeMaker.Import(importedExpr, false)
}
}
return JavacList.from(imports)
}
private fun convertMetadataAnnotation(metadata: Metadata): JCAnnotation {
val argumentsWithNames = mapOf(
"k" to metadata.kind,
"mv" to metadata.metadataVersion.toList(),
"bv" to metadata.bytecodeVersion.toList(),
"d1" to metadata.data1.toList(),
"d2" to metadata.data2.toList(),
"xs" to metadata.extraString,
"pn" to metadata.packageName,
"xi" to metadata.extraInt,
)
val arguments = argumentsWithNames.map { (name, value) ->
val jValue = convertLiteralExpression(value)
treeMaker.Assign(treeMaker.SimpleName(name), jValue)
}
return treeMaker.Annotation(treeMaker.FqName(Metadata::class.java.canonicalName), JavacList.from(arguments))
}
context(UnresolvedQualifiersRecorder)
private fun convertAnnotation(
containingClass: PsiClass,
annotation: PsiAnnotation,
packageFqName: String
): JCAnnotation? {
val rawQualifiedName = annotation.qualifiedName ?: return null
val fqName = treeMaker.getQualifiedName(rawQualifiedName)
if (BLACKLISTED_ANNOTATIONS.any { fqName.startsWith(it) }) return null
if (stripMetadata && fqName == KOTLIN_METADATA_ANNOTATION) return null
val annotationFqName = annotation.resolveAnnotationType()?.defaultType.convertAndRecordErrors {
val useSimpleName = '.' in fqName && fqName.substringBeforeLast('.', "") == packageFqName
when {
useSimpleName -> treeMaker.FqName(fqName.substring(packageFqName.length + 1))
else -> treeMaker.FqName(fqName)
}
}
val values = mapJList<_, JCExpression>(annotation.parameterList.attributes) {
val name = it.name?.takeIf { name -> isValidIdentifier(name) } ?: return@mapJList null
val value = it.value
val expr = if (value == null) {
((it as? KtLightElementBase)?.kotlinOrigin as? KtDotQualifiedExpression)?.let { convertDotQualifiedExpression(it) }
?: return@mapJList null
} else {
convertPsiAnnotationMemberValue(containingClass, value, packageFqName)
}
treeMaker.Assign(treeMaker.SimpleName(name), expr)
}
return treeMaker.Annotation(annotationFqName, values)
}
private fun convertDotQualifiedExpression(dotQualifiedExpression: KtDotQualifiedExpression): JCExpression? {
val qualifier = dotQualifiedExpression.lastChild as? KtNameReferenceExpression ?: return null
val name = qualifier.text.takeIf { isValidIdentifier(it) } ?: "InvalidFieldName"
val lhs = when(val left = dotQualifiedExpression.firstChild) {
is KtNameReferenceExpression -> treeMaker.SimpleName(left.getReferencedName())
is KtDotQualifiedExpression -> convertDotQualifiedExpression(left) ?: return null
else -> return null
}
return treeMaker.Select(lhs, treeMaker.name(name))
}
context(UnresolvedQualifiersRecorder)
private fun convertPsiAnnotationMemberValue(
containingClass: PsiClass,
value: PsiAnnotationMemberValue,
packageFqName: String,
): JCExpression? {
return when (value) {
is PsiArrayInitializerMemberValue -> {
val arguments = mapJList(value.initializers) {
convertPsiAnnotationMemberValue(containingClass, it, packageFqName)
}
treeMaker.NewArray(null, null, arguments)
}
is PsiLiteral -> convertLiteralExpression(value.value)
is PsiClassObjectAccessExpression -> {
val type = value.operand.type
checkIfValidTypeName(containingClass, type)
treeMaker.Select(treeMaker.SimpleName(type.qualifiedName), treeMaker.name("class"))
}
is PsiAnnotation -> convertAnnotation(containingClass, value, packageFqName)
else -> treeMaker.SimpleName(value.text)
}
}
context(UnresolvedQualifiersRecorder)
private fun convertModifiers(
containingClass: PsiClass,
access: Long,
kind: ElementKind,
packageFqName: String,
allAnnotations: List<PsiAnnotation>,
metadata: Metadata?,
excludeNullabilityAnnotations: Boolean = false,
): JCModifiers {
var seenDeprecated = false
fun convertAndAdd(list: JavacList<JCAnnotation>, annotation: PsiAnnotation): JavacList<JCAnnotation> {
seenDeprecated = seenDeprecated or annotation.hasQualifiedName("java.lang.Deprecated")
if (excludeNullabilityAnnotations &&
(annotation.hasQualifiedName("org.jetbrains.annotations.NotNull") || annotation.hasQualifiedName("org.jetbrains.annotations.Nullable"))
) return list
val annotationTree = convertAnnotation(containingClass, annotation, packageFqName) ?: return list
return list.prepend(annotationTree)
}
var annotations = allAnnotations.reversed().fold(JavacList.nil(), ::convertAndAdd)
if (!seenDeprecated && isDeprecated(access)) {
val type = treeMaker.RawType(Type.getType(java.lang.Deprecated::class.java))
annotations = annotations.append(treeMaker.Annotation(type, JavacList.nil()))
}
if (metadata != null) {
annotations = annotations.prepend(convertMetadataAnnotation(metadata))
}
val flags = when (kind) {
ElementKind.ENUM -> access and CLASS_MODIFIERS and Opcodes.ACC_ABSTRACT.inv().toLong()
ElementKind.CLASS -> access and CLASS_MODIFIERS
ElementKind.METHOD -> access and METHOD_MODIFIERS
ElementKind.FIELD -> access and FIELD_MODIFIERS
ElementKind.PARAMETER -> access and PARAMETER_MODIFIERS
else -> throw IllegalArgumentException("Invalid element kind: $kind")
}
return treeMaker.Modifiers(flags, annotations)
}
class KaptStub(val file: JCCompilationUnit, private val kaptMetadata: ByteArray) {
fun writeMetadataIfNeeded(forSource: File): File {
val metadataFile = File(
forSource.parentFile,
forSource.nameWithoutExtension + KaptStubLineInformation.KAPT_METADATA_EXTENSION
)
metadataFile.writeBytes(kaptMetadata)
return metadataFile
}
}
context(UnresolvedQualifiersRecorder)
private fun convertField(
field: PsiField,
containingClass: PsiClass,
lineMappings: Kapt4LineMappingCollector,
packageFqName: String,
explicitInitializer: JCExpression? = null
): JCVariableDecl? {
val fieldAnnotations = field.annotations.asList()
if (isIgnored(fieldAnnotations)) return null
val access = field.accessFlags
val modifiers = convertModifiers(
containingClass,
access, ElementKind.FIELD, packageFqName,
fieldAnnotations,
metadata = null
)
val name = field.name
if (!isValidIdentifier(name)) return null
val type = field.type
if (!checkIfValidTypeName(containingClass, type)) return null
// Enum type must be an identifier (Javac requirement)
val typeExpression = if (isEnum(access)) {
treeMaker.SimpleName(treeMaker.getQualifiedName(type as PsiClassType).substringAfterLast('.'))
} else {
type.convertAndRecordErrors()
}
lineMappings.registerField(containingClass, field)
val skip = field.navigationElement is KtParameter && !dumpDefaultParameterValues
val initializer =
explicitInitializer ?: convertPropertyInitializer(if (skip) null else field.initializer, field.type, field.isFinal)
return treeMaker.VarDef(modifiers, treeMaker.name(name), typeExpression, initializer).keepKdocCommentsIfNecessary(field)
}
private fun convertPropertyInitializer(propertyInitializer: PsiExpression?, type: PsiType, usedDefault: Boolean): JCExpression? {
if (propertyInitializer != null || usedDefault) {
return when (propertyInitializer) {
is PsiLiteralExpression -> {
val rawValue = propertyInitializer.value
val rawNumberValue = rawValue as? Number
val actualValue = when (type) {
PsiType.BYTE -> rawNumberValue?.toByte()
PsiType.SHORT -> rawNumberValue?.toShort()
PsiType.INT -> rawNumberValue?.toInt()
PsiType.LONG -> rawNumberValue?.toLong()
PsiType.FLOAT -> rawNumberValue?.toFloat()
PsiType.DOUBLE -> rawNumberValue?.toDouble()
else -> null
} ?: rawValue
convertValueOfPrimitiveTypeOrString(actualValue)
}
is PsiPrefixExpression -> {
assert(propertyInitializer.operationSign.tokenType == JavaTokenType.MINUS)
val operand = convertPropertyInitializer(propertyInitializer.operand, type, usedDefault)
if (operand.toString().startsWith("-")) operand // overflow
else treeMaker.Unary(Tag.NEG, operand)
}
is PsiBinaryExpression -> {
assert(propertyInitializer.operationSign.tokenType == JavaTokenType.DIV)
treeMaker.Binary(
Tag.DIV,
convertPropertyInitializer(propertyInitializer.lOperand, type, false),
convertPropertyInitializer(propertyInitializer.rOperand, type, false)
)
}
is PsiReferenceExpression ->
when (val resolved = propertyInitializer.resolve()) {
is PsiEnumConstant ->
treeMaker.FqName(resolved.containingClass!!.qualifiedName + "." + resolved.name)
else -> null
}
is PsiArrayInitializerExpression ->
treeMaker.NewArray(
null, JavacList.nil(),
mapJList(propertyInitializer.initializers) { convertPropertyInitializer(it, type.deepComponentType, false) }
)
else -> convertLiteralExpression(getDefaultValue(type))
}
}
return null
}
private fun convertLiteralExpression(value: Any?): JCExpression {
fun convertDeeper(value: Any?) = convertLiteralExpression(value)
convertValueOfPrimitiveTypeOrString(value)?.let { return it }
return when (value) {
null -> treeMaker.Literal(TypeTag.BOT, null)
is ByteArray -> treeMaker.NewArray(null, JavacList.nil(), mapJList(value.asIterable(), ::convertDeeper))
is BooleanArray -> treeMaker.NewArray(null, JavacList.nil(), mapJList(value.asIterable(), ::convertDeeper))
is CharArray -> treeMaker.NewArray(null, JavacList.nil(), mapJList(value.asIterable(), ::convertDeeper))
is ShortArray -> treeMaker.NewArray(null, JavacList.nil(), mapJList(value.asIterable(), ::convertDeeper))
is IntArray -> treeMaker.NewArray(null, JavacList.nil(), mapJList(value.asIterable(), ::convertDeeper))
is LongArray -> treeMaker.NewArray(null, JavacList.nil(), mapJList(value.asIterable(), ::convertDeeper))
is FloatArray -> treeMaker.NewArray(null, JavacList.nil(), mapJList(value.asIterable(), ::convertDeeper))
is DoubleArray -> treeMaker.NewArray(null, JavacList.nil(), mapJList(value.asIterable(), ::convertDeeper))
is Array<*> -> { // Two-element String array for enumerations ([desc, fieldName])
assert(value.size == 2)
val enumType = Type.getType(value[0] as String)
val valueName = (value[1] as String).takeIf { isValidIdentifier(it) } ?: run {
compiler.log.report(kaptError("'${value[1]}' is an invalid Java enum value name"))
"InvalidFieldName"
}
treeMaker.Select(treeMaker.RawType(enumType), treeMaker.name(valueName))
}
is List<*> -> treeMaker.NewArray(null, JavacList.nil(), mapJList(value, ::convertDeeper))
else -> throw IllegalArgumentException("Illegal literal expression value: $value (${value::class.java.canonicalName})")
}
}
private fun getDefaultValue(type: PsiType): Any? = when (type) {
PsiType.BYTE -> 0
PsiType.BOOLEAN -> false
PsiType.CHAR -> '\u0000'
PsiType.SHORT -> 0
PsiType.INT -> 0
PsiType.LONG -> 0L
PsiType.FLOAT -> 0.0F
PsiType.DOUBLE -> 0.0
else -> null
}
private fun convertValueOfPrimitiveTypeOrString(value: Any?): JCExpression? {
fun specialFpValueNumerator(value: Double): Double = if (value.isNaN()) 0.0 else 1.0 * value.sign
val convertedValue = when (value) {
is Char -> treeMaker.Literal(TypeTag.CHAR, value.code)
is Byte -> treeMaker.TypeCast(treeMaker.TypeIdent(TypeTag.BYTE), treeMaker.Literal(TypeTag.INT, value.toInt()))
is Short -> treeMaker.TypeCast(treeMaker.TypeIdent(TypeTag.SHORT), treeMaker.Literal(TypeTag.INT, value.toInt()))
is Boolean, is Int, is Long, is String -> treeMaker.Literal(value)
is Float -> when {
value.isFinite() -> treeMaker.Literal(value)
else -> treeMaker.Binary(
Tag.DIV,
treeMaker.Literal(specialFpValueNumerator(value.toDouble()).toFloat()),
treeMaker.Literal(0.0F)
)
}
is Double -> when {
value.isFinite() -> treeMaker.Literal(value)
else -> treeMaker.Binary(Tag.DIV, treeMaker.Literal(specialFpValueNumerator(value)), treeMaker.Literal(0.0))
}
null -> treeMaker.Literal(TypeTag.BOT, null)
else -> null
}
return convertedValue
}
context(UnresolvedQualifiersRecorder)
private fun convertMethod(
method: PsiMethod,
containingClass: PsiClass,
lineMappings: Kapt4LineMappingCollector,
packageFqName: String,
): JCMethodDecl? {
if (isIgnored(method.annotations.asList())) return null
val isConstructor = method.isConstructor
val name = method.name
if (!isConstructor && !isValidIdentifier(name)) return null
val returnType = method.returnType ?: PsiType.VOID
val modifiers = convertModifiers(
containingClass,
if (containingClass.isEnum && isConstructor)
(method.accessFlags and VISIBILITY_MODIFIERS.inv())
else
method.accessFlags,
ElementKind.METHOD,
packageFqName,
method.annotations.toList(),
metadata = null,
excludeNullabilityAnnotations = returnType == PsiType.VOID
)
if (method.hasModifierProperty(PsiModifier.DEFAULT)) {
modifiers.flags = modifiers.flags or Flags.DEFAULT
}
val parametersInfo = method.getParametersInfo()
if (!checkIfValidTypeName(containingClass, returnType)
|| parametersInfo.any { !checkIfValidTypeName(containingClass, it.type) }
) {
return null
}
@Suppress("NAME_SHADOWING")
val jParameters = mapJListIndexed(parametersInfo) { index, info ->
val lastParameter = index == parametersInfo.lastIndex
val isArrayType = info.type is PsiArrayType
val varargs = if (lastParameter && isArrayType && method.isVarArgs) Flags.VARARGS else 0L
val modifiers = convertModifiers(
containingClass,
Flags.PARAMETER or varargs, // Kapt never marked method parameters as "final"
ElementKind.PARAMETER,
packageFqName,
info.annotations,
metadata = null
)
val defaultName = info.name
val name = when {
isValidIdentifier(defaultName) -> defaultName
defaultName == SpecialNames.IMPLICIT_SET_PARAMETER.asString() -> "p0"
else -> "p${index}_${info.name.hashCode().ushr(1)}"
}
val type = info.type.convertAndRecordErrors()
treeMaker.VarDef(modifiers, treeMaker.name(name), type, null)
}
val jTypeParameters = mapJList(method.typeParameters) { convertTypeParameter(it) }
val jExceptionTypes = mapJList(method.throwsTypes) { treeMaker.TypeWithArguments(it as PsiType) }
val jReturnType = runUnless(isConstructor) {
returnType.convertAndRecordErrors()
}
val defaultValue = (method as? PsiAnnotationMethod)?.defaultValue?.let {
convertPsiAnnotationMemberValue(containingClass, it, packageFqName)
}
val body = if (defaultValue != null) {
null
} else if (method.isAbstract or (modifiers.flags and Flags.ABSTRACT.toLong() != 0L)) {
null
} else if (isConstructor && containingClass.isEnum) {
treeMaker.Block(0, JavacList.nil())
} else if (isConstructor) {
val superConstructor = containingClass.superClass?.constructors?.firstOrNull { !it.isPrivate }
val superClassConstructorCall = if (superConstructor != null) {
val args = mapJList(superConstructor.parameterList.parameters) { param ->
convertLiteralExpression(getDefaultValue(param.type))
}
val call = treeMaker.Apply(JavacList.nil(), treeMaker.SimpleName("super"), args)
JavacList.of<JCStatement>(treeMaker.Exec(call))
} else {
JavacList.nil()
}
treeMaker.Block(0, superClassConstructorCall)
} else if (returnType == PsiType.VOID) {
treeMaker.Block(0, JavacList.nil())
} else {
val returnStatement = treeMaker.Return(convertLiteralExpression(getDefaultValue(returnType)))
treeMaker.Block(0, JavacList.of(returnStatement))
}
lineMappings.registerMethod(containingClass, method)
return treeMaker.MethodDef(
modifiers, treeMaker.name(name), jReturnType, jTypeParameters,
jParameters, jExceptionTypes,
body, defaultValue
).keepSignature(lineMappings, method).keepKdocCommentsIfNecessary(method)
}
private fun JCMethodDecl.keepSignature(lineMappings: Kapt4LineMappingCollector, method: PsiMethod): JCMethodDecl {
lineMappings.registerSignature(this, method)
return this
}
private fun <T : JCTree> T.keepKdocCommentsIfNecessary(element: PsiElement): T {
kdocCommentKeeper?.saveKDocComment(this, element)
return this
}
private fun isIgnored(annotations: List<PsiAnnotation>?): Boolean {
val kaptIgnoredAnnotationFqName = KaptIgnored::class.java.canonicalName
return annotations?.any { it.hasQualifiedName(kaptIgnoredAnnotationFqName) } ?: false
}
context(UnresolvedQualifiersRecorder)
private fun checkIfValidTypeName(
containingClass: PsiClass,
type: PsiType
): Boolean {
when (type) {
is PsiArrayType -> return checkIfValidTypeName(containingClass, type.componentType)
is PsiPrimitiveType -> return true
}
val internalName = type.qualifiedName
// Ignore type names with Java keywords in it
if (internalName.split('/', '.').any { it in JAVA_KEYWORDS }) {
if (strictMode) {
reportKaptError(
"Can't generate a stub for '${internalName}'.",
"Type name '${type.qualifiedName}' contains a Java keyword."
)
}
return false
}
val clazz = type.resolvedClass ?: return true
if (doesInnerClassNameConflictWithOuter(clazz)) {
if (strictMode) {
reportKaptError(
"Can't generate a stub for '${clazz.qualifiedNameWithDollars}'.",
"Its name '${clazz.name}' is the same as one of the outer class names.",
"Java forbids it. Please change one of the class names."
)
}
return false
}
reportIfIllegalTypeUsage(containingClass, type)
return true
}
private fun findContainingClassNode(clazz: PsiClass): PsiClass? {
return clazz.parent as? PsiClass
}
// Java forbids outer and inner class names to be the same. Check if the names are different
private tailrec fun doesInnerClassNameConflictWithOuter(
clazz: PsiClass,
outerClass: PsiClass? = findContainingClassNode(clazz)
): Boolean {
if (outerClass == null) return false
if (treeMaker.getSimpleName(clazz) == treeMaker.getSimpleName(outerClass)) return true
// Try to find the containing class for outerClassNode (to check the whole tree recursively)
val containingClassForOuterClass = findContainingClassNode(outerClass) ?: return false
return doesInnerClassNameConflictWithOuter(clazz, containingClassForOuterClass)
}
context(UnresolvedQualifiersRecorder)
private fun reportIfIllegalTypeUsage(
containingClass: PsiClass,
type: PsiType
) {
val typeName = type.simpleNameOrNull ?: return
if (typeName !in reportedTypes && typeName in importsFromRoot) {
reportedTypes += typeName
val msg = "${containingClass.qualifiedName}: Can't reference type '${typeName}' from default package in Java stub."
if (strictMode) reportKaptError(msg)
else logger.warn(msg)
}
}
context(UnresolvedQualifiersRecorder)
@OptIn(ExperimentalContracts::class)
private inline fun PsiType?.convertAndRecordErrors(
ifNonError: () -> JCExpression = { treeMaker.TypeWithArguments(this!!) }
): JCExpression {
contract {
callsInPlace(ifNonError, InvocationKind.EXACTLY_ONCE)
}
this?.recordErrorTypes()
return ifNonError()
}
context(UnresolvedQualifiersRecorder)
private fun PsiType.recordErrorTypes() {
if (this is PsiEllipsisType) {
this.componentType.recordErrorTypes()
return
}
if (qualifiedNameOrNull == null) {
recordUnresolvedQualifier(qualifiedName)
}
when (this) {
is PsiClassType -> typeArguments().forEach { (it as? PsiType)?.recordErrorTypes() }
is PsiArrayType -> componentType.recordErrorTypes()
}
}
private fun isValidQualifiedName(name: FqName) = name.pathSegments().all { isValidIdentifier(it.asString()) }
private fun isValidIdentifier(name: String): Boolean {
if (name in JAVA_KEYWORDS) return false
return !(name.isEmpty()
|| !Character.isJavaIdentifierStart(name[0])
|| name.drop(1).any { !Character.isJavaIdentifierPart(it) })
}
private class ClassGenericSignature(
val typeParameters: JavacList<JCTypeParameter>,
val superClass: JCExpression,
val interfaces: JavacList<JCExpression>,
val superClassIsObject: Boolean
)
context(UnresolvedQualifiersRecorder)
private fun parseClassSignature(psiClass: PsiClass): ClassGenericSignature {
val superClasses = mutableListOf<JCExpression>()
val superInterfaces = mutableListOf<JCExpression>()
val superPsiClasses = psiClass.extendsListTypes.toList()
val superPsiInterfaces = psiClass.implementsListTypes.toList()
fun addSuperType(superType: PsiClassType, destination: MutableList<JCExpression>) {
if (psiClass.isAnnotationType && superType.qualifiedName == "java.lang.annotation.Annotation") return
destination += superType.convertAndRecordErrors()
}
var superClassIsObject = false
superPsiClasses.forEach {
addSuperType(it, superClasses)
superClassIsObject = superClassIsObject || it.qualifiedNameOrNull == "java.lang.Object"
}
for (superInterface in superPsiInterfaces) {
if (superInterface.qualifiedName.startsWith("kotlin.collections.")) continue
addSuperType(superInterface, superInterfaces)
}
val jcTypeParameters = mapJList(psiClass.typeParameters) { convertTypeParameter(it) }
val jcSuperClass = superClasses.firstOrNull().takeUnless { psiClass.isInterface } ?: createJavaLangObjectType().also {
superClassIsObject = true
}
val jcInterfaces = JavacList.from(if (psiClass.isInterface) superClasses else superInterfaces)
return ClassGenericSignature(jcTypeParameters, jcSuperClass, jcInterfaces, superClassIsObject)
}
private fun createJavaLangObjectType(): JCExpression {
return treeMaker.FqName("java.lang.Object")
}
context(UnresolvedQualifiersRecorder)
private fun convertTypeParameter(typeParameter: PsiTypeParameter): JCTypeParameter {
val classBounds = mutableListOf<JCExpression>()
val interfaceBounds = mutableListOf<JCExpression>()
val bounds = typeParameter.bounds
for (bound in bounds) {
val boundType = bound as? PsiType ?: continue
val jBound = boundType.convertAndRecordErrors()
if (boundType.resolvedClass?.isInterface == false) {
classBounds += jBound
} else {
interfaceBounds += jBound
}
}
if (classBounds.isEmpty() && interfaceBounds.isEmpty()) {
classBounds += createJavaLangObjectType()
}
return treeMaker.TypeParameter(treeMaker.name(typeParameter.name!!), JavacList.from(classBounds + interfaceBounds))
}
private class UnresolvedQualifiersRecorder(ktFiles: Iterable<KtFile>) {
val importsFromRoot: Set<String> by lazy {
val importsFromRoot =
ktFiles
.flatMap { it.importDirectives }
.filter { !it.isAllUnder }
.mapNotNull { im -> im.importPath?.fqName?.takeIf { it.isOneSegmentFQN() } }
importsFromRoot.mapTo(mutableSetOf()) { it.asString() }
}
private val _qualifiedNames = mutableSetOf<String>()
private val _simpleNames = mutableSetOf<String>()
val reportedTypes = mutableSetOf<String>()
val qualifiedNames: Set<String>
get() = _qualifiedNames
val simpleNames: Set<String>
get() = _simpleNames
fun isEmpty(): Boolean {
return simpleNames.isEmpty()
}
fun recordUnresolvedQualifier(qualifier: String) {
val separated = qualifier.split(".")
if (separated.size > 1) {
_qualifiedNames += qualifier
_simpleNames += separated.first()
} else {
_simpleNames += qualifier
}
}
}
@Suppress("UNUSED_PARAMETER")
private fun calculateMetadata(lightClass: PsiClass): Metadata? {
if (stripMetadata) return null
return Metadata() // TODO: calculate me
}
}
@@ -0,0 +1,141 @@
/*
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.kapt4
import com.intellij.psi.*
import com.sun.tools.javac.code.BoundKind
import com.sun.tools.javac.code.TypeTag
import com.sun.tools.javac.tree.JCTree
import com.sun.tools.javac.tree.TreeMaker
import com.sun.tools.javac.util.Context
import com.sun.tools.javac.util.Name
import com.sun.tools.javac.util.Names
import org.jetbrains.kotlin.builtins.StandardNames
import org.jetbrains.kotlin.codegen.AsmUtil
import org.jetbrains.org.objectweb.asm.Type
import org.jetbrains.org.objectweb.asm.Type.*
internal class Kapt4TreeMaker(
context: Context
) : TreeMaker(context) {
val nameTable: Name.Table = Names.instance(context).table
@Suppress("FunctionName")
fun RawType(type: Type): JCTree.JCExpression {
convertBuiltinType(type)?.let { return it }
if (type.sort == ARRAY) {
return TypeArray(RawType(AsmUtil.correctElementType(type)))
}
return FqName(type.internalName)
}
@Suppress("FunctionName")
private fun RawType(type: PsiType): JCTree.JCExpression {
return when (type) {
is PsiArrayType -> TypeArray(RawType(type.componentType))
is PsiWildcardType -> Wildcard(TypeBoundKind(BoundKind.UNBOUND), null)
else -> FqName(type.qualifiedName)
}
}
@Suppress("FunctionName")
fun TypeWithArguments(type: PsiType): JCTree.JCExpression {
return when (type) {
is PsiArrayType -> TypeArray(TypeWithArguments(type.componentType))
is PsiClassType -> {
val correctedType = if (isErroneous(type)) type.rawType() else type
SimpleName(correctedType.canonicalText.replace('$', '.'))
} // TODO: Produce a proper expression, see KT-60821
is PsiWildcardType -> {
val argumentType = type.bound?.let { TypeWithArguments(it) }
when {
type.isExtends -> Wildcard(TypeBoundKind(BoundKind.EXTENDS), argumentType)
type.isSuper -> Wildcard(TypeBoundKind(BoundKind.SUPER), argumentType)
else -> Wildcard(TypeBoundKind(BoundKind.UNBOUND), argumentType)
}
}
else -> RawType(type)
}
}
private fun isErroneous(type: PsiType): Boolean {
if (type.canonicalText == StandardNames.NON_EXISTENT_CLASS.asString()) return true
if (type is PsiClassType) return type.parameters.any { isErroneous(it) }
return false
}
@Suppress("FunctionName")
fun FqName(internalOrFqName: String): JCTree.JCExpression {
val path = getQualifiedName(internalOrFqName).convertSpecialFqName().split('.')
assert(path.isNotEmpty())
return FqName(path)
}
@Suppress("FunctionName")
private fun FqName(path: List<String>): JCTree.JCExpression {
if (path.size == 1) return SimpleName(path.single())
var expr = Select(SimpleName(path[0]), name(path[1]))
for (index in 2..path.lastIndex) {
expr = Select(expr, name(path[index]))
}
return expr
}
fun getQualifiedName(type: PsiClassType): String {
val klass = type.resolve() ?: return getQualifiedName(type.qualifiedName)
return getQualifiedName(klass)
}
private fun getQualifiedName(type: PsiClass): String = getQualifiedName(type.qualifiedName!!)
fun getSimpleName(clazz: PsiClass): String = clazz.name!!
fun getQualifiedName(internalName: String): String {
val nameWithDots = internalName.replace('/', '.')
// This is a top-level class
if ('$' !in nameWithDots) return nameWithDots
return nameWithDots.replace('$', '.')
}
private fun String.convertSpecialFqName(): String {
// Hard-coded in ImplementationBodyCodegen, KOTLIN_MARKER_INTERFACES
if (this == "kotlin.jvm.internal.markers.KMutableMap\$Entry") {
return replace('$', '.')
}
return this
}
private fun convertBuiltinType(type: Type): JCTree.JCExpression? {
val typeTag = when (type) {
BYTE_TYPE -> TypeTag.BYTE
BOOLEAN_TYPE -> TypeTag.BOOLEAN
CHAR_TYPE -> TypeTag.CHAR
SHORT_TYPE -> TypeTag.SHORT
INT_TYPE -> TypeTag.INT
LONG_TYPE -> TypeTag.LONG
FLOAT_TYPE -> TypeTag.FLOAT
DOUBLE_TYPE -> TypeTag.DOUBLE
VOID_TYPE -> TypeTag.VOID
else -> null
} ?: return null
return TypeIdent(typeTag)
}
@Suppress("FunctionName")
fun SimpleName(name: String): JCTree.JCExpression = Ident(name(name))
fun name(name: String): Name = nameTable.fromString(name)
companion object {
internal fun preRegister(context: Context) {
context.put(treeMakerKey, Context.Factory { Kapt4TreeMaker(it) })
}
}
}

Some files were not shown because too many files have changed in this diff Show More