KT-50728 Enforce receiver type resolve

When stdlib is represented as a source dependency (which seems to be the
case in the `kotlin` project), it will be resolved lazily for the IDE.
Same thing can happen if someone decides to "extend" the stdlib
by declaring their declaration in the `kotlin` package

In both of those cases, we need to make sure that receiver type is fully
resolved before trying to get a `coneType` from it

N.B. To make resolve tests work, I've added a separate folder
`withAllowedKotlinPackage` to the `testData`, because in the default
test setup it is not allowed to extend the `kotlin` package by user's
definitions

^KT-50728 Fixed
This commit is contained in:
Roman Golyshev
2022-01-11 17:08:41 +03:00
committed by Space
parent 3ac472ceb3
commit 54cca88279
8 changed files with 113 additions and 1 deletions
@@ -19,6 +19,7 @@ import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirective
import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives.WITH_REFLECT
import org.jetbrains.kotlin.test.directives.ConfigurationDirectives.WITH_STDLIB
import org.jetbrains.kotlin.test.directives.LanguageSettingsDirectives
import org.jetbrains.kotlin.test.directives.LanguageSettingsDirectives.ALLOW_KOTLIN_PACKAGE
import org.jetbrains.kotlin.test.directives.LanguageSettingsDirectives.LANGUAGE
import org.jetbrains.kotlin.test.frontend.fir.FirFailingTestSuppressor
import org.jetbrains.kotlin.test.frontend.fir.FirFrontendFacade
@@ -100,6 +101,12 @@ fun TestConfigurationBuilder.baseFirDiagnosticTestConfiguration(
}
}
forTestsMatching("compiler/fir/analysis-tests/testData/resolve/withAllowedKotlinPackage/*") {
defaultDirectives {
+ALLOW_KOTLIN_PACKAGE
}
}
forTestsMatching(
"compiler/testData/diagnostics/testsWithStdLib/*" or
"compiler/fir/analysis-tests/testData/resolveWithStdlib/*" or