Reproduce KT-45327: false positive MUST_INITIALIZED_OR_BE_ABSTRACT after conditional exitProcess

This commit is contained in:
Jinseong Jeon
2021-03-05 23:21:59 -08:00
committed by Dmitriy Novozhilov
parent 628d75c7cd
commit d8fb54c6bd
5 changed files with 49 additions and 0 deletions
@@ -30708,6 +30708,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
runTest("compiler/testData/diagnostics/testsWithStdLib/elvisOnUnitInLet.kt");
}
@Test
@TestMetadata("exitProcess.kt")
public void testExitProcess() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/exitProcess.kt");
}
@Test
@TestMetadata("hugeUnresolvedKotlinxHtml.kt")
public void testHugeUnresolvedKotlinxHtml() throws Exception {
@@ -0,0 +1,14 @@
import java.io.File
import kotlin.system.exitProcess
object Main {
<!MUST_BE_INITIALIZED_OR_BE_ABSTRACT!>private val KOTLIN_HOME: File<!>
init {
val home = System.getProperty("kotlin.home")
if (home == null) {
exitProcess(1)
}
KOTLIN_HOME = File(home)
}
}
@@ -0,0 +1,14 @@
import java.io.File
import kotlin.system.exitProcess
object Main {
private val KOTLIN_HOME: File
init {
val home = System.getProperty("kotlin.home")
if (home == null) {
exitProcess(1)
}
KOTLIN_HOME = File(home)
}
}
@@ -0,0 +1,9 @@
package
public object Main {
private constructor Main()
private final val KOTLIN_HOME: java.io.File
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
@@ -30804,6 +30804,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
runTest("compiler/testData/diagnostics/testsWithStdLib/elvisOnUnitInLet.kt");
}
@Test
@TestMetadata("exitProcess.kt")
public void testExitProcess() throws Exception {
runTest("compiler/testData/diagnostics/testsWithStdLib/exitProcess.kt");
}
@Test
@TestMetadata("hugeUnresolvedKotlinxHtml.kt")
public void testHugeUnresolvedKotlinxHtml() throws Exception {