Skip to content

Commit

Permalink
FIR: Fix DiagnosticsTestGenerated when FIR starts requesting light cl…
Browse files Browse the repository at this point in the history
…asses

Became necessary after fixing loading Java annotation from deserialization
  • Loading branch information
dzharkov committed Nov 3, 2020
1 parent a936386 commit aa81041
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ package org.jetbrains.kotlin.checkers
import com.intellij.openapi.util.io.FileUtil
import com.intellij.openapi.util.text.StringUtil
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiElementFinder
import com.intellij.psi.search.GlobalSearchScope
import com.intellij.rt.execution.junit.FileComparisonFailure
import junit.framework.AssertionFailedError
import junit.framework.TestCase
import org.jetbrains.kotlin.TestsCompilerError
import org.jetbrains.kotlin.analyzer.AnalysisResult
import org.jetbrains.kotlin.analyzer.common.CommonResolverForModuleFactory
import org.jetbrains.kotlin.asJava.finder.JavaElementFinder
import org.jetbrains.kotlin.builtins.StandardNames
import org.jetbrains.kotlin.builtins.jvm.JvmBuiltIns
import org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport
Expand Down Expand Up @@ -292,6 +294,7 @@ abstract class AbstractDiagnosticsTest : BaseDiagnosticsTest() {
}
if (testDataFile.readText().contains("// FIR_IDENTICAL")) {
try {
PsiElementFinder.EP.getPoint(environment.project).unregisterExtension(JavaElementFinder::class.java)
testRunner.analyzeAndCheckUnhandled(testDataFile, files)
} catch (e: FileComparisonFailure) {
println("Old FE & FIR produces different diagnostics for this file. Please remove FIR_IDENTICAL line manually")
Expand Down

0 comments on commit aa81041

Please sign in to comment.