Don't report UNUSED_PARAMETER in main from object #KT-37718 Fixed

This commit is contained in:
Mikhail Glukhikh
2020-03-26 18:25:51 +03:00
parent cec0f58544
commit 7bfd354a77
6 changed files with 35 additions and 0 deletions
@@ -742,6 +742,11 @@ public class FirOldFrontendDiagnosticsTestWithStdlibGenerated extends AbstractFi
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/localFun_LL13.kt");
}
@TestMetadata("mainInObject.kt")
public void testMainInObject() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/mainInObject.kt");
}
@TestMetadata("property.kt")
public void testProperty() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/property.kt");
@@ -745,6 +745,11 @@ class ControlFlowInformationProvider private constructor(
}
return
}
else -> {
if (owner.containingClassOrObject != null) {
return
}
}
}
}
if (functionDescriptor.isOperator && functionName in OperatorNameConventions.DELEGATED_PROPERTY_OPERATORS) {
@@ -0,0 +1,6 @@
// FIR_IDENTICAL
object Test {
@JvmStatic
fun main(args: Array<String>) {
}
}
@@ -0,0 +1,9 @@
package
public object Test {
private constructor Test()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
@kotlin.jvm.JvmStatic public final fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -743,6 +743,11 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/localFun_LL13.kt");
}
@TestMetadata("mainInObject.kt")
public void testMainInObject() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/mainInObject.kt");
}
@TestMetadata("property.kt")
public void testProperty() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/property.kt");
@@ -743,6 +743,11 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/localFun_LL13.kt");
}
@TestMetadata("mainInObject.kt")
public void testMainInObject() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/mainInObject.kt");
}
@TestMetadata("property.kt")
public void testProperty() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/annotations/jvmStatic/property.kt");