KT-6810 Don't report warnings in dummy.kt
#KT-6810 Fixed
This commit is contained in:
@@ -123,6 +123,12 @@ public class KotlincExecutableTestGenerated extends AbstractKotlincExecutableTes
|
||||
doJvmTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("warningsInDummy.args")
|
||||
public void testWarningsInDummy() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/cli/jvm/warningsInDummy.args");
|
||||
doJvmTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("wrongAbiVersion.args")
|
||||
public void testWrongAbiVersion() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/cli/jvm/wrongAbiVersion.args");
|
||||
|
||||
@@ -61,4 +61,9 @@ public class K2JvmCliTest extends CliBaseTest {
|
||||
public void conflictingOverloads() throws Exception {
|
||||
executeCompilerCompareOutputJVM();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void warningsInDummy() throws Exception {
|
||||
executeCompilerCompareOutputJVM();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,13 +18,13 @@ package org.jetbrains.kotlin.resolve
|
||||
|
||||
import org.junit.Assert
|
||||
import org.jetbrains.kotlin.diagnostics.Diagnostic
|
||||
import org.jetbrains.kotlin.psi.JetPsiFactory
|
||||
import org.jetbrains.kotlin.cli.jvm.compiler.JetCoreEnvironment
|
||||
import org.jetbrains.kotlin.resolve.lazy.KotlinTestWithEnvironment
|
||||
import org.jetbrains.kotlin.config.CompilerConfiguration
|
||||
import org.jetbrains.kotlin.resolve.diagnostics.Diagnostics
|
||||
import org.jetbrains.kotlin.resolve.diagnostics.MutableDiagnosticsWithSuppression
|
||||
import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
|
||||
class MutableDiagnosticsTest : KotlinTestWithEnvironment() {
|
||||
override fun createEnvironment(): JetCoreEnvironment? {
|
||||
@@ -132,6 +132,10 @@ class MutableDiagnosticsTest : KotlinTestWithEnvironment() {
|
||||
private inner class DummyDiagnostic : Diagnostic {
|
||||
val dummyElement = JetPsiFactory(getEnvironment().getProject()).createType("Int")
|
||||
|
||||
;{
|
||||
dummyElement.getContainingJetFile().doNotAnalyze = null
|
||||
}
|
||||
|
||||
override fun getFactory() = unimplemented()
|
||||
override fun getSeverity() = unimplemented()
|
||||
override fun getPsiElement() = dummyElement
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ public class CapturedTypeApproximationTest() : JetLiteFixture() {
|
||||
|
||||
appendln(testType)
|
||||
|
||||
if (bindingContext.getDiagnostics().any { it.getSeverity() == Severity.ERROR }) {
|
||||
if (bindingContext.getDiagnostics().noSuppression().any { it.getSeverity() == Severity.ERROR }) {
|
||||
appendln(" compiler error\n")
|
||||
continue
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user