Make @JvmStatic work on JVM_IR

This commit is contained in:
Georgy Bronnikov
2018-07-06 18:20:26 +03:00
parent 2547612d54
commit 8478c73434
34 changed files with 439 additions and 25 deletions
@@ -977,7 +977,7 @@ public class KotlinTypeMapper {
}
@NotNull
private String mapFunctionName(@NotNull FunctionDescriptor descriptor) {
public String mapFunctionName(@NotNull FunctionDescriptor descriptor) {
if (!(descriptor instanceof JavaCallableMemberDescriptor)) {
String platformName = getJvmName(descriptor);
if (platformName != null) return platformName;
@@ -460,6 +460,8 @@ private fun IrFunction.generateDefaultsFunction(context: CommonBackendContext):
result.valueParameters += newValueParameters.also { it.forEach { it.parent = result } }
function.annotations.mapTo(result.annotations) { it.deepCopyWithSymbols() }
result
}
}
@@ -30,6 +30,7 @@ interface JvmLoweredDeclarationOrigin : IrDeclarationOrigin {
object FIELD_FOR_OUTER_THIS : IrDeclarationOriginImpl("FIELD_FOR_OUTER_THIS")
object SYNTHETIC_ACCESSOR : IrDeclarationOriginImpl("SYNTHETIC_ACCESSOR")
object TO_ARRAY : IrDeclarationOriginImpl("TO_ARRAY")
object JVM_STATIC_WRAPPER : IrDeclarationOriginImpl("JVM_STATIC_WRAPPER")
}
interface JvmLoweredStatementOrigin : IrStatementOrigin {
@@ -20,7 +20,6 @@ import org.jetbrains.kotlin.backend.common.lower.*
import org.jetbrains.kotlin.backend.common.runOnFilePostfix
import org.jetbrains.kotlin.backend.jvm.lower.*
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import org.jetbrains.kotlin.descriptors.Visibilities
import org.jetbrains.kotlin.ir.declarations.IrFile
import org.jetbrains.kotlin.ir.util.PatchDeclarationParentsVisitor
import org.jetbrains.kotlin.ir.visitors.acceptVoid
@@ -40,7 +39,6 @@ class JvmLower(val context: JvmBackendContext) {
//Should be before interface lowering
DefaultArgumentStubGenerator(context, false).runOnFilePostfix(irFile)
StaticDefaultFunctionLowering(context.state).runOnFilePostfix(irFile)
InterfaceLowering(context.state).runOnFilePostfix(irFile)
InterfaceDelegationLowering(context.state).runOnFilePostfix(irFile)
@@ -64,6 +62,8 @@ class JvmLower(val context: JvmBackendContext) {
SingletonReferencesLowering(context).runOnFilePostfix(irFile)
SyntheticAccessorLowering(context).lower(irFile)
BridgeLowering(context).runOnFilePostfix(irFile)
JvmStaticAnnotationLowering(context).lower(irFile)
StaticDefaultFunctionLowering(context.state).runOnFilePostfix(irFile)
TailrecLowering(context).runOnFilePostfix(irFile)
ToArrayLowering(context).runOnFilePostfix(irFile)
@@ -18,8 +18,7 @@ import org.jetbrains.org.objectweb.asm.Type
class IrFrameMap : FrameMapBase<IrSymbol>()
internal val IrFunction.isStatic
get() = (this.dispatchReceiverParameter == null && this !is IrConstructor) ||
(parentAsClass.isObject && this.hasAnnotation(JVM_STATIC_ANNOTATION_FQ_NAME)) //TODO add lowering
get() = (this.dispatchReceiverParameter == null && this !is IrConstructor)
fun IrFrameMap.enter(irDeclaration: IrSymbolOwner, type: Type): Int {
return enter(irDeclaration.symbol, type)
@@ -0,0 +1,247 @@
/*
* Copyright 2010-2018 JetBrains s.r.o. 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.backend.jvm.lower
import org.jetbrains.kotlin.backend.common.ClassLoweringPass
import org.jetbrains.kotlin.backend.common.FileLoweringPass
import org.jetbrains.kotlin.backend.common.lower.createIrBuilder
import org.jetbrains.kotlin.backend.common.lower.irBlock
import org.jetbrains.kotlin.backend.common.lower.irBlockBody
import org.jetbrains.kotlin.backend.common.runOnFilePostfix
import org.jetbrains.kotlin.backend.jvm.JvmBackendContext
import org.jetbrains.kotlin.backend.jvm.JvmLoweredDeclarationOrigin
import org.jetbrains.kotlin.backend.jvm.descriptors.JvmFunctionDescriptorImpl
import org.jetbrains.kotlin.codegen.AsmUtil
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.descriptors.Visibilities
import org.jetbrains.kotlin.descriptors.Visibility
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.annotations.JVM_STATIC_ANNOTATION_FQ_NAME
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
import org.jetbrains.kotlin.ir.declarations.*
import org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl
import org.jetbrains.kotlin.ir.expressions.*
import org.jetbrains.kotlin.ir.expressions.impl.*
import org.jetbrains.kotlin.ir.symbols.IrFunctionSymbol
import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol
import org.jetbrains.kotlin.ir.symbols.impl.IrSimpleFunctionSymbolImpl
import org.jetbrains.kotlin.ir.types.classifierOrFail
import org.jetbrains.kotlin.ir.util.*
import org.jetbrains.kotlin.ir.visitors.*
import org.jetbrains.org.objectweb.asm.Opcodes
/*
* For @JvmStatic functions within companion objects of classes, we synthesize proxy static functions that redirect
* to the actual implementation.
* For @JvmStatic functions within static objects, we make the actual function static and modify all call sites.
*/
class JvmStaticAnnotationLowering(val context: JvmBackendContext) : IrElementTransformerVoid(), FileLoweringPass {
override fun lower(irFile: IrFile) {
CompanionObjectJvmStaticLowering(context).runOnFilePostfix(irFile)
val functionsMadeStatic =
SingletonObjectJvmStaticLowering(context).apply { runOnFilePostfix(irFile) }.functionsMadeStatic
irFile.transformChildrenVoid(MakeCallsStatic(context, functionsMadeStatic))
}
}
private class CompanionObjectJvmStaticLowering(val context: JvmBackendContext) : ClassLoweringPass {
override fun lower(irClass: IrClass) {
val companion = irClass.declarations.find {
it is IrClass && it.isCompanion
} as IrClass?
companion?.declarations?.filter(::isJvmStaticFunction)?.forEach {
val jvmStaticFunction = it as IrSimpleFunction
val newName = Name.identifier(context.state.typeMapper.mapFunctionName(jvmStaticFunction.symbol.descriptor))
if (AsmUtil.getVisibilityAccessFlag(jvmStaticFunction.descriptor) != Opcodes.ACC_PUBLIC) {
// TODO: Synthetic accessor creation logic should be supported in SyntheticAccessorLowering in the future.
val accessorName = Name.identifier("access\$$newName")
val accessor = createProxy(
jvmStaticFunction, companion, companion, accessorName, Visibilities.PUBLIC,
isSynthetic = true
)
companion.addMember(accessor)
val proxy = createProxy(
accessor, irClass, companion, newName, jvmStaticFunction.visibility, isSynthetic = false
)
irClass.addMember(proxy)
} else {
val proxy = createProxy(
jvmStaticFunction, irClass, companion, newName, jvmStaticFunction.visibility,
isSynthetic = false
)
irClass.addMember(proxy)
}
}
}
private fun createProxy(
target: IrFunction,
irClass: IrClass,
companion: IrClass,
name: Name,
visibility: Visibility,
isSynthetic: Boolean
): IrFunction {
val proxyFunctionSymbol = makeJvmStaticFunctionSymbol(irClass, target.symbol, name, visibility, isSynthetic)
val proxyIrFunction = IrFunctionImpl(
UNDEFINED_OFFSET, UNDEFINED_OFFSET,
JvmLoweredDeclarationOrigin.JVM_STATIC_WRAPPER,
proxyFunctionSymbol
)
proxyIrFunction.returnType = target.returnType
proxyIrFunction.createParameterDeclarations()
val companionInstanceFieldSymbol = context.descriptorsFactory.getSymbolForObjectInstance(companion.symbol)
context.createIrBuilder(proxyIrFunction.symbol).irBlockBody(proxyIrFunction) {
val call = IrCallImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, target.returnType, target.symbol)
call.dispatchReceiver = IrGetFieldImpl(
UNDEFINED_OFFSET,
UNDEFINED_OFFSET,
companionInstanceFieldSymbol,
companion.defaultType
)
proxyIrFunction.extensionReceiverParameter?.let {
call.extensionReceiver = IrGetValueImpl(
UNDEFINED_OFFSET,
UNDEFINED_OFFSET,
it.symbol
)
}
proxyIrFunction.valueParameters.mapIndexed { i, valueParameter ->
call.putValueArgument(
i,
IrGetValueImpl(
UNDEFINED_OFFSET,
UNDEFINED_OFFSET,
valueParameter.symbol
)
)
}
+IrReturnImpl(
UNDEFINED_OFFSET,
UNDEFINED_OFFSET,
proxyIrFunction.returnType,
proxyIrFunction.symbol,
call
)
}.apply {
proxyIrFunction.body = this
}
return proxyIrFunction
}
}
private class SingletonObjectJvmStaticLowering(
val context: JvmBackendContext
) : ClassLoweringPass {
val functionsMadeStatic: MutableSet<IrFunctionSymbol> = mutableSetOf()
override fun lower(irClass: IrClass) {
if (!irClass.isObject || irClass.isCompanion) return
irClass.declarations.filter(::isJvmStaticFunction).forEach {
val jvmStaticFunction = it as IrSimpleFunction
val oldDispatchReceiverParemeter = jvmStaticFunction.dispatchReceiverParameter!!
jvmStaticFunction.dispatchReceiverParameter = null
modifyBody(jvmStaticFunction, irClass, oldDispatchReceiverParemeter)
functionsMadeStatic.add(jvmStaticFunction.symbol)
}
}
fun modifyBody(irFunction: IrFunction, irClass: IrClass, oldDispatchReceiverParameter: IrValueParameter) {
irFunction.body = irFunction.body?.transform(ReplaceThisByStaticReference(context, irClass, oldDispatchReceiverParameter), null)
}
}
private class ReplaceThisByStaticReference(
val context: JvmBackendContext,
val irClass: IrClass,
val oldThisReceiverParameter: IrValueParameter
) : IrElementTransformer<Nothing?> {
override fun visitGetValue(expression: IrGetValue, data: Nothing?): IrExpression {
val irGetValue = expression
if (irGetValue.symbol == oldThisReceiverParameter.symbol) {
val instanceSymbol = context.descriptorsFactory.getSymbolForObjectInstance(irClass.symbol)
return IrGetFieldImpl(
expression.startOffset,
expression.endOffset,
instanceSymbol,
irClass.defaultType
)
}
return super.visitGetValue(irGetValue, data)
}
}
private class MakeCallsStatic(
val context: JvmBackendContext,
val functionsMadeStatic: Set<IrFunctionSymbol>
) : IrElementTransformerVoid() {
override fun visitCall(expression: IrCall): IrExpression {
if (functionsMadeStatic.contains(expression.symbol)) {
return context.createIrBuilder(expression.symbol, expression.startOffset, expression.endOffset).irBlock(expression) {
// OldReceiver has to be evaluated for its side effects.
val oldReceiver = super.visitExpression(expression.dispatchReceiver!!)
// `coerceToUnit()` is private in InsertImplicitCasts, have to reproduce it here
val oldReceiverVoid = IrTypeOperatorCallImpl(
oldReceiver.startOffset, oldReceiver.endOffset,
context.irBuiltIns.unitType,
IrTypeOperator.IMPLICIT_COERCION_TO_UNIT,
context.irBuiltIns.unitType, context.irBuiltIns.unitType.classifierOrFail,
oldReceiver
)
+super.visitExpression(oldReceiverVoid)
expression.dispatchReceiver = null
+super.visitCall(expression)
}
}
return super.visitCall(expression)
}
}
private fun isJvmStaticFunction(declaration: IrDeclaration): Boolean =
declaration is IrSimpleFunction &&
(declaration.hasAnnotation(JVM_STATIC_ANNOTATION_FQ_NAME) ||
declaration.correspondingProperty?.hasAnnotation(JVM_STATIC_ANNOTATION_FQ_NAME) == true)
private fun makeJvmStaticFunctionSymbol(
ownerClass: IrClass,
oldFunctionSymbol: IrFunctionSymbol,
newName: Name,
visibility: Visibility,
isSynthetic: Boolean
): IrSimpleFunctionSymbol {
val proxyDescriptorForIrFunction = JvmFunctionDescriptorImpl(
ownerClass.descriptor,
null,
oldFunctionSymbol.descriptor.annotations,
newName,
CallableMemberDescriptor.Kind.SYNTHESIZED,
oldFunctionSymbol.descriptor.source,
extraFlags = if (isSynthetic) Opcodes.ACC_SYNTHETIC else 0
)
proxyDescriptorForIrFunction.initialize(
oldFunctionSymbol.descriptor.extensionReceiverParameter?.type,
null,
oldFunctionSymbol.descriptor.typeParameters,
oldFunctionSymbol.descriptor.valueParameters.map { it.copy(proxyDescriptorForIrFunction, it.name, it.index) },
oldFunctionSymbol.descriptor.returnType,
// FINAL on static interface members makes JVM unhappy, so remove it.
if (ownerClass.isInterface) Modality.OPEN else oldFunctionSymbol.descriptor.modality,
visibility
)
return IrSimpleFunctionSymbolImpl(proxyDescriptorForIrFunction)
}
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// TARGET_BACKEND: JVM
// FILE: J.java
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
@@ -0,0 +1,56 @@
// !LANGUAGE: +JvmStaticInInterface
// JVM_TARGET: 1.8
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
// WITH_RUNTIME
// FILE: Test.java
class Test {
public static String test1() {
return A.test1();
}
public static String test2() {
return A.test2();
}
public static String test3() {
return A.test3("JAVA");
}
public static String test4() {
return A.getC();
}
}
// FILE: simpleCompanionObject.kt
interface A {
companion object {
val b: String = "OK"
@JvmStatic val c: String = "OK"
@JvmStatic fun test1() = b
@JvmStatic fun test2() = b
@JvmStatic fun String.test3() = this + b
}
}
fun box(): String {
if (Test.test1() != "OK") return "fail 1"
if (Test.test2() != "OK") return "fail 2"
if (Test.test3() != "JAVAOK") return "fail 3"
if (Test.test4() != "OK") return "fail 4"
return "OK"
}
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
// TARGET_BACKEND: JVM
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
// TARGET_BACKEND: JVM
object ObjectThisTest {
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
@@ -12240,6 +12240,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/jvmStatic/inlinePropertyAccessors.kt");
}
@TestMetadata("interfaceCompanion.kt")
public void testInterfaceCompanion() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/interfaceCompanion.kt");
}
@TestMetadata("kt21246.kt")
public void testKt21246() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/kt21246.kt");
@@ -12314,6 +12319,19 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
public void testSyntheticAccessor() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/syntheticAccessor.kt");
}
@TestMetadata("compiler/testData/codegen/box/jvmStatic/META-INF")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class META_INF extends AbstractIrBlackBoxCodegenTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM_IR, testDataFilePath);
}
public void testAllFilesPresentInMETA_INF() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/jvmStatic/META-INF"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true);
}
}
}
@TestMetadata("compiler/testData/codegen/box/labels")
@@ -12240,6 +12240,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/jvmStatic/inlinePropertyAccessors.kt");
}
@TestMetadata("interfaceCompanion.kt")
public void testInterfaceCompanion() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/interfaceCompanion.kt");
}
@TestMetadata("kt21246.kt")
public void testKt21246() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/kt21246.kt");
@@ -12314,6 +12319,19 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
public void testSyntheticAccessor() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/syntheticAccessor.kt");
}
@TestMetadata("compiler/testData/codegen/box/jvmStatic/META-INF")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class META_INF extends AbstractBlackBoxCodegenTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInMETA_INF() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/jvmStatic/META-INF"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
}
}
@TestMetadata("compiler/testData/codegen/box/labels")
@@ -12240,6 +12240,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/jvmStatic/inlinePropertyAccessors.kt");
}
@TestMetadata("interfaceCompanion.kt")
public void testInterfaceCompanion() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/interfaceCompanion.kt");
}
@TestMetadata("kt21246.kt")
public void testKt21246() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/kt21246.kt");
@@ -12314,6 +12319,19 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
public void testSyntheticAccessor() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/syntheticAccessor.kt");
}
@TestMetadata("compiler/testData/codegen/box/jvmStatic/META-INF")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class META_INF extends AbstractLightAnalysisModeTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath);
}
public void testAllFilesPresentInMETA_INF() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/jvmStatic/META-INF"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
}
}
}
@TestMetadata("compiler/testData/codegen/box/labels")
@@ -119,7 +119,6 @@ public class BasicCompletionHandlerTestGenerated extends AbstractBasicCompletion
runTest("idea/idea-completion/testData/handlers/basic/KT23627.kt");
}
@TestMetadata("NestedTypeArg.kt")
public void testNestedTypeArg() throws Exception {
runTest("idea/idea-completion/testData/handlers/basic/NestedTypeArg.kt");
@@ -3937,6 +3937,45 @@ public class QuickFixMultiFileTestGenerated extends AbstractQuickFixMultiFileTes
}
}
@TestMetadata("idea/testData/quickfix/typeMismatch/numberConversion")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class NumberConversion extends AbstractQuickFixMultiFileTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithExtraFile, TargetBackend.ANY, testDataFilePath);
}
public void testAllFilesPresentInNumberConversion() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/quickfix/typeMismatch/numberConversion"), Pattern.compile("^(\\w+)\\.((before\\.Main\\.\\w+)|(test))$"), TargetBackend.ANY, true);
}
}
@TestMetadata("idea/testData/quickfix/typeMismatch/parameterTypeMismatch")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ParameterTypeMismatch extends AbstractQuickFixMultiFileTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithExtraFile, TargetBackend.ANY, testDataFilePath);
}
public void testAllFilesPresentInParameterTypeMismatch() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/quickfix/typeMismatch/parameterTypeMismatch"), Pattern.compile("^(\\w+)\\.((before\\.Main\\.\\w+)|(test))$"), TargetBackend.ANY, true);
}
}
@TestMetadata("idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class TypeMismatchOnReturnedExpression extends AbstractQuickFixMultiFileTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTestWithExtraFile, TargetBackend.ANY, testDataFilePath);
}
public void testAllFilesPresentInTypeMismatchOnReturnedExpression() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/quickfix/typeMismatch/typeMismatchOnReturnedExpression"), Pattern.compile("^(\\w+)\\.((before\\.Main\\.\\w+)|(test))$"), TargetBackend.ANY, true);
}
}
@TestMetadata("idea/testData/quickfix/typeMismatch/wrapWithCollectionLiteral")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
@@ -10735,6 +10735,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/jvmStatic/inlinePropertyAccessors.kt");
}
@TestMetadata("interfaceCompanion.kt")
public void testInterfaceCompanion() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/interfaceCompanion.kt");
}
@TestMetadata("kt9897_static.kt")
public void testKt9897_static() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/kt9897_static.kt");
@@ -10794,6 +10799,19 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
public void testSyntheticAccessor() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/syntheticAccessor.kt");
}
@TestMetadata("compiler/testData/codegen/box/jvmStatic/META-INF")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class META_INF extends AbstractIrJsCodegenBoxTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath);
}
public void testAllFilesPresentInMETA_INF() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/jvmStatic/META-INF"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true);
}
}
}
@TestMetadata("compiler/testData/codegen/box/labels")
@@ -11730,6 +11730,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
runTest("compiler/testData/codegen/box/jvmStatic/inlinePropertyAccessors.kt");
}
@TestMetadata("interfaceCompanion.kt")
public void testInterfaceCompanion() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/interfaceCompanion.kt");
}
@TestMetadata("kt9897_static.kt")
public void testKt9897_static() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/kt9897_static.kt");
@@ -11789,6 +11794,19 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
public void testSyntheticAccessor() throws Exception {
runTest("compiler/testData/codegen/box/jvmStatic/syntheticAccessor.kt");
}
@TestMetadata("compiler/testData/codegen/box/jvmStatic/META-INF")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class META_INF extends AbstractJsCodegenBoxTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath);
}
public void testAllFilesPresentInMETA_INF() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/jvmStatic/META-INF"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true);
}
}
}
@TestMetadata("compiler/testData/codegen/box/labels")