mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-04-14 08:31:29 +00:00
Compare commits
279 Commits
rr/pdn_byt
...
rr/pdn_dir
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aeedc143d1 | ||
|
|
7313ce0669 | ||
|
|
ecc4ee7dcd | ||
|
|
c2a46baa77 | ||
|
|
640d263ae1 | ||
|
|
656c2496a6 | ||
|
|
614d529168 | ||
|
|
47dc524763 | ||
|
|
90798d8857 | ||
|
|
f9087a8ab1 | ||
|
|
accc0e3761 | ||
|
|
0ba6412f96 | ||
|
|
bbe5cf0a70 | ||
|
|
e14848740a | ||
|
|
626c1d3b48 | ||
|
|
7cea639209 | ||
|
|
ac0aaff611 | ||
|
|
bdfc879f00 | ||
|
|
d2f831b635 | ||
|
|
7ac599520e | ||
|
|
6919f3dbb5 | ||
|
|
bf85b110da | ||
|
|
cd7841ceed | ||
|
|
f574f89f78 | ||
|
|
40eeee48b6 | ||
|
|
cbe3c66156 | ||
|
|
209ec68591 | ||
|
|
5ff4d648f4 | ||
|
|
6182228de8 | ||
|
|
c98dba6aea | ||
|
|
cf5e6b242b | ||
|
|
e9af2849ef | ||
|
|
6bc4e124fb | ||
|
|
d70b889004 | ||
|
|
36a25353e9 | ||
|
|
ac9e8f667d | ||
|
|
05872fc6a8 | ||
|
|
df815a64cf | ||
|
|
6a51ddf755 | ||
|
|
b7eded6e48 | ||
|
|
e56a3b3c30 | ||
|
|
686368749a | ||
|
|
7388e60869 | ||
|
|
042ac5555c | ||
|
|
27903b4cd6 | ||
|
|
d306d8a90e | ||
|
|
124bd559de | ||
|
|
f83841a34f | ||
|
|
9273c6326e | ||
|
|
7a745cfe5c | ||
|
|
417c841f77 | ||
|
|
e56b39bbd8 | ||
|
|
d09be811f0 | ||
|
|
0b8b20eda0 | ||
|
|
53aafbd7d9 | ||
|
|
00031c8eb1 | ||
|
|
34387e228f | ||
|
|
06ba143afe | ||
|
|
6e3009b82e | ||
|
|
d60a8f9baa | ||
|
|
a58f29aa06 | ||
|
|
66f39ca185 | ||
|
|
ebbef484ad | ||
|
|
1385a4690e | ||
|
|
7f627ab480 | ||
|
|
939740d26e | ||
|
|
9baa24e626 | ||
|
|
b6fa28ea81 | ||
|
|
1181854bd6 | ||
|
|
a30cfc332d | ||
|
|
9f53d70109 | ||
|
|
776920f77d | ||
|
|
18f617a582 | ||
|
|
87d05bcf83 | ||
|
|
e451ecf000 | ||
|
|
1936a815e2 | ||
|
|
db55a973d4 | ||
|
|
d4717569b9 | ||
|
|
7bb81ef157 | ||
|
|
787c743333 | ||
|
|
1be39cb505 | ||
|
|
e2e173b92c | ||
|
|
4d346d3735 | ||
|
|
0b46ed3cde | ||
|
|
08688670b1 | ||
|
|
c6fc393417 | ||
|
|
afa1b8bfdc | ||
|
|
4994cb3774 | ||
|
|
80181c1091 | ||
|
|
1c0d40055e | ||
|
|
98cc99e36b | ||
|
|
f5caa49c31 | ||
|
|
0882da1788 | ||
|
|
01dd15cc3e | ||
|
|
ad9f6e63b6 | ||
|
|
5eed9a4e6e | ||
|
|
ff27a61252 | ||
|
|
571c9c10d4 | ||
|
|
56cad96718 | ||
|
|
b3d8187df4 | ||
|
|
61e21ef6a2 | ||
|
|
cba21c68a3 | ||
|
|
e2dc21da90 | ||
|
|
19d939c36e | ||
|
|
7ee6597873 | ||
|
|
bb37728e4f | ||
|
|
f94ed1a00c | ||
|
|
291cd842b9 | ||
|
|
dad198cb67 | ||
|
|
03d4cb0dfa | ||
|
|
eac875b5d6 | ||
|
|
f37c722c76 | ||
|
|
40eaabdbb5 | ||
|
|
225e3a747c | ||
|
|
efba90c6f1 | ||
|
|
c14a890e7e | ||
|
|
b389fd6667 | ||
|
|
d9be05fea8 | ||
|
|
c24ad0ba51 | ||
|
|
75d2e415e1 | ||
|
|
5e456ed82b | ||
|
|
41ab97ff1f | ||
|
|
babf079c31 | ||
|
|
9e1bc5680d | ||
|
|
ef5f0e77ec | ||
|
|
aff807e3af | ||
|
|
4942f5eb66 | ||
|
|
fdb091d98e | ||
|
|
09a94f3200 | ||
|
|
3503a54437 | ||
|
|
65ce641b22 | ||
|
|
b771f9eea4 | ||
|
|
0c77565104 | ||
|
|
6095d8a7fa | ||
|
|
6d9f02cfc6 | ||
|
|
0764a0601c | ||
|
|
a1ed81146e | ||
|
|
b48850c993 | ||
|
|
7349ec8f2f | ||
|
|
ec440aecf6 | ||
|
|
9d9e11d6d8 | ||
|
|
0d9e32f963 | ||
|
|
9eaec8d919 | ||
|
|
2a2fa31577 | ||
|
|
624740a80a | ||
|
|
2eda82f178 | ||
|
|
8f97d8a78e | ||
|
|
df225c0c7f | ||
|
|
83e3a702c5 | ||
|
|
ef2c2c2c9e | ||
|
|
3160fc84fa | ||
|
|
a6a7da31c9 | ||
|
|
b6bd4ae8e6 | ||
|
|
84e67da2af | ||
|
|
95d95f9a9b | ||
|
|
8dd307573a | ||
|
|
80a449862e | ||
|
|
84ccf7bbb1 | ||
|
|
5de8401494 | ||
|
|
4fb78fab93 | ||
|
|
c9568c0744 | ||
|
|
7c62e9aecd | ||
|
|
e110b49cab | ||
|
|
287ff3ed55 | ||
|
|
6365164c21 | ||
|
|
13464cce68 | ||
|
|
f330d67740 | ||
|
|
78ffefe107 | ||
|
|
909f0d8bdb | ||
|
|
2e57ff25ee | ||
|
|
072bba109f | ||
|
|
e93133a28f | ||
|
|
b9536a25d6 | ||
|
|
bc5e92033b | ||
|
|
24685ee9d6 | ||
|
|
89270399db | ||
|
|
cdcde634e8 | ||
|
|
757fdb2b32 | ||
|
|
71755b7a5e | ||
|
|
1f0616439c | ||
|
|
6065f0e2d0 | ||
|
|
8f097b14cc | ||
|
|
6f9694174f | ||
|
|
57bd4d3a98 | ||
|
|
49e838781c | ||
|
|
788d3c022a | ||
|
|
9cbcafa8d1 | ||
|
|
72804d2e8c | ||
|
|
f3a935adb9 | ||
|
|
25ebb3fa75 | ||
|
|
274d18a141 | ||
|
|
8dd71ec5c8 | ||
|
|
f9d2ca68ce | ||
|
|
caff279255 | ||
|
|
e4a5775570 | ||
|
|
8afb6d2761 | ||
|
|
b58bea6fa1 | ||
|
|
07daf2165a | ||
|
|
b88f54b31a | ||
|
|
3e883120dd | ||
|
|
7ec709cf46 | ||
|
|
9b39a8abc2 | ||
|
|
887032667d | ||
|
|
5f582ad28a | ||
|
|
61825e9aec | ||
|
|
816e955c61 | ||
|
|
201b6dfa60 | ||
|
|
85456bd6d8 | ||
|
|
007f11e22e | ||
|
|
ddf451739b | ||
|
|
d438d2db40 | ||
|
|
77ae1fa1f2 | ||
|
|
663c0d975d | ||
|
|
602be42b24 | ||
|
|
66683d2952 | ||
|
|
c8a81911c0 | ||
|
|
f0199d7277 | ||
|
|
cb89bd0e13 | ||
|
|
5d296a01c2 | ||
|
|
dbaaf081d7 | ||
|
|
df51856e65 | ||
|
|
8147a88353 | ||
|
|
cc05d91bda | ||
|
|
59b5475350 | ||
|
|
84d78035e4 | ||
|
|
276ffd5a4b | ||
|
|
d10f734594 | ||
|
|
7149d08995 | ||
|
|
cccf9b7d54 | ||
|
|
81a7271009 | ||
|
|
e43835c9f5 | ||
|
|
525cc6df97 | ||
|
|
b8002cb54f | ||
|
|
beba85a848 | ||
|
|
f7fdffefd6 | ||
|
|
b34e2c1474 | ||
|
|
72849a3dc3 | ||
|
|
bdf914e8d5 | ||
|
|
07b15f9de6 | ||
|
|
32c3f85679 | ||
|
|
7e052c1eb1 | ||
|
|
2a08923c51 | ||
|
|
8925b8c922 | ||
|
|
1afb844e1a | ||
|
|
12331cb10c | ||
|
|
d54808e33f | ||
|
|
f2f2df90aa | ||
|
|
660208740e | ||
|
|
704b5a0e13 | ||
|
|
ea2d9f7c0c | ||
|
|
cc4adb798f | ||
|
|
0c6066db74 | ||
|
|
0c0710bb79 | ||
|
|
71365d2452 | ||
|
|
dfc6d85aee | ||
|
|
dc2485ae71 | ||
|
|
37ccd82b6c | ||
|
|
19a5c2f1c8 | ||
|
|
e5128a8772 | ||
|
|
ccc27b6a0c | ||
|
|
6f2af740cb | ||
|
|
ed3542cdf5 | ||
|
|
666ad1f9d5 | ||
|
|
ea7ea979ee | ||
|
|
e2acc507d4 | ||
|
|
9cb740bfdb | ||
|
|
a1c1a32515 | ||
|
|
af2d0ad36f | ||
|
|
1835185b16 | ||
|
|
edb6b337dc | ||
|
|
e69b729e21 | ||
|
|
4282d17467 | ||
|
|
b88913af1d | ||
|
|
9a4742c08d | ||
|
|
9cf5ac1fbd | ||
|
|
a9cc046ec9 | ||
|
|
2c29957cb8 | ||
|
|
e96f64e6c9 | ||
|
|
b59f668a50 |
40
ChangeLog.md
40
ChangeLog.md
@@ -1,5 +1,45 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 1.4.32
|
||||
|
||||
### IDE
|
||||
|
||||
- [`KT-43824`](https://youtrack.jetbrains.com/issue/KT-43824) KtLightClassForSourceDeclaration#isInheritor works in a different way than java implementation
|
||||
- [`KT-45287`](https://youtrack.jetbrains.com/issue/KT-45287) LightClasses: `KtLightSimpleModifierList` is no more a parent of `KtLightAnnotationForSourceEntry`
|
||||
- [`KT-45291`](https://youtrack.jetbrains.com/issue/KT-45291) LightClasses: can't get annotations for constructor val-parameter
|
||||
- [`KT-45417`](https://youtrack.jetbrains.com/issue/KT-45417) ULC leakage of primitive type annotations
|
||||
|
||||
### Tools. CLI
|
||||
|
||||
- [`KT-44758`](https://youtrack.jetbrains.com/issue/KT-44758) kotlin-compiler-embeddable dependency includes unshaded `fastutil` package
|
||||
- [`KT-45007`](https://youtrack.jetbrains.com/issue/KT-45007) Concurrent Kotlin script compilation/execution results in NullPointerException in KeyedExtensionCollector.getPoint()
|
||||
|
||||
## 1.4.31
|
||||
|
||||
### Compiler
|
||||
|
||||
- [`KT-39776`](https://youtrack.jetbrains.com/issue/KT-39776) 2020.3+: Unresolved reference to Kotlin stdlib function
|
||||
|
||||
### IDE. Gradle Integration
|
||||
|
||||
- [`KT-44845`](https://youtrack.jetbrains.com/issue/KT-44845) After update to Kotlin 1.4.30 all external dependencies is unresolved in IDE with kotlin.mpp.enableGranularSourceSetsMetadata=true
|
||||
|
||||
### IDE. Gradle. Script
|
||||
|
||||
- [`KTIJ-11137`](https://youtrack.jetbrains.com/issue/KTIJ-1137) build.gradle.kts: Fatal error during save/load standalone scripts settings
|
||||
- [`KTIJ-898`](https://youtrack.jetbrains.com/issue/KTIJ-898) Unable to import with Kotlin DSL buildscript - NullPointerException in KotlinDslScriptModelProcessorKt.toListOfScriptModels
|
||||
|
||||
### IDE. Multiplatform
|
||||
|
||||
- [`KTIJ-1200`](https://youtrack.jetbrains.com/issue/KTIJ-1200) KotlinIconProviderKt.addExpectActualMarker takes up to 180+ seconds
|
||||
|
||||
### IDE
|
||||
|
||||
#### Fixes
|
||||
|
||||
- [`KT-44697`](https://youtrack.jetbrains.com/issue/KT-44697) New JVM IR backend notification - narrow its triggering to Kotlin projects
|
||||
- [`KT-44523`](https://youtrack.jetbrains.com/issue/KT-44523) IDE notification for trying new JVM backend
|
||||
- [`KTIJ-696`](https://youtrack.jetbrains.com/issue/KTIJ-696) Freeze during startup of IDEA with intellij project with Kotlin (211-1.4.10-release-IJ1440)
|
||||
|
||||
## 1.4.30
|
||||
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
[](https://www.apache.org/licenses/LICENSE-2.0)
|
||||
[](https://ge.jetbrains.com/scans?search.rootProjectNames=Kotlin)
|
||||
|
||||
[Join Kotlin 1.5 Online Event on May 25, 2021!](https://pages.jetbrains.com/kotlin-online-event-2021/github-readme)
|
||||
|
||||
# Kotlin Programming Language
|
||||
|
||||
Welcome to [Kotlin](https://kotlinlang.org/)!
|
||||
|
||||
@@ -14,8 +14,11 @@ buildscript {
|
||||
|
||||
if (cacheRedirectorEnabled) {
|
||||
maven("https://cache-redirector.jetbrains.com/plugins.gradle.org/m2")
|
||||
maven("https://cache-redirector.jetbrains.com/repo.maven.apache.org/maven2")
|
||||
|
||||
} else {
|
||||
maven("https://plugins.gradle.org/m2")
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +30,7 @@ buildscript {
|
||||
dependencies {
|
||||
bootstrapCompilerClasspath(kotlin("compiler-embeddable", bootstrapKotlinVersion))
|
||||
|
||||
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.26")
|
||||
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.27")
|
||||
classpath(kotlin("gradle-plugin", bootstrapKotlinVersion))
|
||||
classpath(kotlin("serialization", bootstrapKotlinVersion))
|
||||
classpath("org.jetbrains.dokka:dokka-gradle-plugin:0.9.17")
|
||||
@@ -333,7 +336,9 @@ extra["tasksWithWarnings"] = listOf(
|
||||
":kotlin-stdlib-jdk7:compileTestKotlin",
|
||||
":kotlin-stdlib-jdk8:compileTestKotlin",
|
||||
":plugins:uast-kotlin:compileKotlin",
|
||||
":plugins:uast-kotlin:compileTestKotlin"
|
||||
":plugins:uast-kotlin:compileTestKotlin",
|
||||
":plugins:uast-kotlin-fir:compileKotlin",
|
||||
":plugins:uast-kotlin-fir:compileTestKotlin"
|
||||
)
|
||||
|
||||
val tasksWithWarnings: List<String> by extra
|
||||
@@ -378,7 +383,7 @@ apply {
|
||||
}
|
||||
|
||||
apply {
|
||||
if (extra["isSonatypeRelease"] as? Boolean == true) {
|
||||
if (extra["isDeployStagingRepoGenerationRequired"] as? Boolean == true) {
|
||||
logger.info("Applying configuration for sonatype release")
|
||||
from("libraries/prepareSonatypeStaging.gradle")
|
||||
}
|
||||
@@ -844,11 +849,12 @@ tasks {
|
||||
":idea:idea-fir:test",
|
||||
":idea:idea-frontend-api:test",
|
||||
":idea:idea-frontend-fir:test",
|
||||
":idea:idea-frontend-fir:idea-fir-low-level-api:test"
|
||||
":idea:idea-frontend-fir:idea-fir-low-level-api:test",
|
||||
":plugins:uast-kotlin-fir:test",
|
||||
":idea:idea-fir-fe10-binding:test"
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
register("android-ide-tests") {
|
||||
dependsOn("dist")
|
||||
dependsOn(
|
||||
@@ -894,7 +900,6 @@ tasks {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
register("kaptIdeTest") {
|
||||
dependsOn(":kotlin-annotation-processing:test")
|
||||
dependsOn(":kotlin-annotation-processing-base:test")
|
||||
@@ -962,6 +967,7 @@ tasks {
|
||||
":prepare:ide-plugin-dependencies:sam-with-receiver-compiler-plugin-for-ide:publish",
|
||||
":prepare:ide-plugin-dependencies:compiler-components-for-jps:publish",
|
||||
":prepare:ide-plugin-dependencies:parcelize-compiler-plugin-for-ide:publish",
|
||||
":prepare:ide-plugin-dependencies:lombok-compiler-plugin-for-ide:publish",
|
||||
":kotlin-script-runtime:publish",
|
||||
":kotlin-script-util:publish",
|
||||
":kotlin-scripting-common:publish",
|
||||
|
||||
@@ -22,7 +22,7 @@ buildscript {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.26")
|
||||
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.27")
|
||||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${project.bootstrapKotlinVersion}")
|
||||
classpath("org.jetbrains.kotlin:kotlin-sam-with-receiver:${project.bootstrapKotlinVersion}")
|
||||
}
|
||||
@@ -144,7 +144,7 @@ java {
|
||||
dependencies {
|
||||
implementation(kotlin("stdlib", embeddedKotlinVersion))
|
||||
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:${project.bootstrapKotlinVersion}")
|
||||
implementation("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.26")
|
||||
implementation("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.27")
|
||||
implementation("com.gradle.publish:plugin-publish-plugin:0.14.0")
|
||||
|
||||
implementation("net.rubygrapefruit:native-platform:${property("versions.native-platform")}")
|
||||
|
||||
@@ -18,9 +18,10 @@ buildscript {
|
||||
} else {
|
||||
maven { url "https://maven.pkg.jetbrains.space/kotlin/p/kotlin/kotlin-dependencies" }
|
||||
}
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.26")
|
||||
classpath("org.jetbrains.kotlin:kotlin-build-gradle-plugin:0.0.27")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -229,23 +229,6 @@ fun Project.publish(moduleMetadata: Boolean = false, configure: MavenPublication
|
||||
publication.configure()
|
||||
}
|
||||
|
||||
fun Project.publishWithLegacyMavenPlugin(body: Upload.() -> Unit = {}): Upload {
|
||||
apply<plugins.PublishedKotlinModule>()
|
||||
|
||||
if (artifactsRemovedDiagnosticFlag) {
|
||||
error("`publish()` should be called before removing artifacts typically done in `noDefaultJar()` or `runtimeJar()` call")
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
if (configurations.findByName("classes-dirs") != null)
|
||||
throw GradleException("classesDirsArtifact() is incompatible with publish(), see sources comments for details")
|
||||
}
|
||||
|
||||
return (tasks.getByName("uploadArchives") as Upload).apply {
|
||||
body()
|
||||
}
|
||||
}
|
||||
|
||||
fun Project.idePluginDependency(block: () -> Unit) {
|
||||
val shouldActivate = rootProject.findProperty("publish.ide.plugin.dependencies")?.toString()?.toBoolean() == true
|
||||
if (shouldActivate) {
|
||||
|
||||
@@ -164,7 +164,17 @@ fun Project.configureDefaultPublishing() {
|
||||
private fun Project.configureSigning() {
|
||||
configure<SigningExtension> {
|
||||
sign(extensions.getByType<PublishingExtension>().publications) // all publications
|
||||
useGpgCmd()
|
||||
|
||||
val signKeyId = project.findProperty("signKeyId") as? String
|
||||
if (!signKeyId.isNullOrBlank()) {
|
||||
val signKeyPrivate = project.findProperty("signKeyPrivate") as? String
|
||||
?: error("Parameter `signKeyPrivate` not found")
|
||||
val signKeyPassphrase = project.findProperty("signKeyPassphrase") as? String
|
||||
?: error("Parameter `signKeyPassphrase` not found")
|
||||
useInMemoryPgpKeys(signKeyId, signKeyPrivate, signKeyPassphrase)
|
||||
} else {
|
||||
useGpgCmd()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,173 +0,0 @@
|
||||
@file:Suppress("DEPRECATION")
|
||||
package plugins
|
||||
|
||||
import org.codehaus.groovy.runtime.InvokerHelper
|
||||
import org.gradle.api.Plugin
|
||||
import org.gradle.api.Project
|
||||
import org.gradle.api.artifacts.Dependency
|
||||
import org.gradle.api.artifacts.maven.Conf2ScopeMappingContainer
|
||||
import org.gradle.api.artifacts.maven.MavenDeployment
|
||||
import org.gradle.api.artifacts.maven.MavenResolver
|
||||
import org.gradle.api.plugins.MavenPluginConvention
|
||||
import org.gradle.api.plugins.MavenRepositoryHandlerConvention
|
||||
import org.gradle.api.publication.maven.internal.deployer.MavenRemoteRepository
|
||||
import org.gradle.api.tasks.Upload
|
||||
import org.gradle.kotlin.dsl.*
|
||||
import org.gradle.plugins.signing.Sign
|
||||
import org.gradle.plugins.signing.SigningExtension
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
/**
|
||||
* Configures a Kotlin module for publication.
|
||||
*/
|
||||
open class PublishedKotlinModule : Plugin<Project> {
|
||||
|
||||
private fun String.toBooleanOrNull() = listOf(true, false).firstOrNull { it.toString().equals(this, ignoreCase = true) }
|
||||
|
||||
override fun apply(project: Project) {
|
||||
|
||||
project.run {
|
||||
|
||||
plugins.apply("maven")
|
||||
|
||||
configurations.maybeCreate("publishedRuntime").apply {
|
||||
the<MavenPluginConvention>()
|
||||
.conf2ScopeMappings
|
||||
.addMapping(0, this, Conf2ScopeMappingContainer.RUNTIME)
|
||||
}
|
||||
|
||||
configurations.maybeCreate("publishedCompile").apply {
|
||||
the<MavenPluginConvention>()
|
||||
.conf2ScopeMappings
|
||||
.addMapping(0, this, Conf2ScopeMappingContainer.COMPILE)
|
||||
}
|
||||
|
||||
if (!project.hasProperty("prebuiltJar")) {
|
||||
plugins.apply("signing")
|
||||
|
||||
val signingRequired = project.findProperty("signingRequired")?.toString()?.toBooleanOrNull()
|
||||
?: project.property("isSonatypeRelease") as Boolean
|
||||
|
||||
configure<SigningExtension> {
|
||||
isRequired = signingRequired
|
||||
sign(configurations["archives"])
|
||||
useGpgCmd()
|
||||
}
|
||||
|
||||
tasks.named<Sign>("signArchives").configure {
|
||||
enabled = signingRequired
|
||||
}
|
||||
}
|
||||
|
||||
fun MavenResolver.configurePom() {
|
||||
pom.project {
|
||||
withGroovyBuilder {
|
||||
"licenses" {
|
||||
"license" {
|
||||
"name"("The Apache Software License, Version 2.0")
|
||||
"url"("http://www.apache.org/licenses/LICENSE-2.0.txt")
|
||||
"distribution"("repo")
|
||||
}
|
||||
}
|
||||
"name"("${project.group}:${project.name}")
|
||||
"packaging"("jar")
|
||||
// optionally artifactId can be defined here
|
||||
"description"(project.description)
|
||||
"url"("https://kotlinlang.org/")
|
||||
"licenses" {
|
||||
"license" {
|
||||
"name"("The Apache License, Version 2.0")
|
||||
"url"("http://www.apache.org/licenses/LICENSE-2.0.txt")
|
||||
}
|
||||
}
|
||||
"scm" {
|
||||
"url"("https://github.com/JetBrains/kotlin")
|
||||
"connection"("scm:git:https://github.com/JetBrains/kotlin.git")
|
||||
"developerConnection"("scm:git:https://github.com/JetBrains/kotlin.git")
|
||||
}
|
||||
"developers" {
|
||||
"developer" {
|
||||
"name"("Kotlin Team")
|
||||
setProperty("organization", "JetBrains")
|
||||
"organizationUrl"("https://www.jetbrains.com")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
pom.whenConfigured {
|
||||
dependencies.removeIf {
|
||||
InvokerHelper.getMetaClass(it).getProperty(it, "scope") == "test"
|
||||
}
|
||||
|
||||
dependencies
|
||||
.find {
|
||||
InvokerHelper.getMetaClass(it).getProperty(it, "groupId") == "org.jetbrains.kotlin"
|
||||
&& InvokerHelper.getMetaClass(it).getProperty(it, "artifactId") == "kotlin-stdlib"
|
||||
}
|
||||
?.also {
|
||||
InvokerHelper.getMetaClass(it).setProperty(it, "exclusions", emptyList<Any>())
|
||||
logger.warn("WARNING! Removed exclusions from kotlin-stdlib dependency of ${this.artifactId} artifact's maven metadata, check kotlin-stdlib dependency of ${project.path} project")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.named<Upload>("uploadArchives").configure {
|
||||
|
||||
val preparePublication = project.rootProject.tasks.named("preparePublication").get()
|
||||
|
||||
dependsOn(preparePublication)
|
||||
|
||||
val username: String? by preparePublication.extra
|
||||
val password: String? by preparePublication.extra
|
||||
val repoUrl: String by preparePublication.extra
|
||||
|
||||
var repository by Delegates.notNull<MavenRemoteRepository>()
|
||||
|
||||
repositories {
|
||||
withConvention(MavenRepositoryHandlerConvention::class) {
|
||||
|
||||
mavenDeployer {
|
||||
withGroovyBuilder {
|
||||
"beforeDeployment" {
|
||||
val signing = project.the<SigningExtension>()
|
||||
if (signing.isRequired)
|
||||
signing.signPom(delegate as MavenDeployment)
|
||||
}
|
||||
|
||||
"repository"("url" to repoUrl)!!.also { repository = it as MavenRemoteRepository }.withGroovyBuilder {
|
||||
if (username != null && password != null) {
|
||||
"authentication"("userName" to username, "password" to password)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configurePom()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
doFirst {
|
||||
repository.url = repoUrl
|
||||
}
|
||||
}
|
||||
|
||||
val install = if (tasks.names.contains("install")) tasks.getByName("install") as Upload
|
||||
else tasks.create("install", Upload::class.java)
|
||||
install.apply {
|
||||
configuration = project.configurations.getByName(Dependency.ARCHIVES_CONFIGURATION)
|
||||
description = "Installs the 'archives' artifacts into the local Maven repository."
|
||||
repositories {
|
||||
withConvention(MavenRepositoryHandlerConvention::class) {
|
||||
mavenInstaller {
|
||||
configurePom()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("publish") {
|
||||
dependsOn(tasks.named("uploadArchives"))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -354,8 +354,8 @@ class CodegenTestsOnAndroidGenerator private constructor(private val pathManager
|
||||
extractor.provideConfigurationKeys()
|
||||
extractor.configure(keyConfiguration, module.directives)
|
||||
}
|
||||
val kind = configuratorForFlags.extractConfigurationKind(module.directives)
|
||||
val jdkKind = configuratorForFlags.extractJdkKind(module.directives)
|
||||
val kind = JvmEnvironmentConfigurator.extractConfigurationKind(module.directives)
|
||||
val jdkKind = JvmEnvironmentConfigurator.extractJdkKind(module.directives)
|
||||
|
||||
keyConfiguration.languageVersionSettings = module.languageVersionSettings
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ interface TypeMappingContext<Writer : JvmDescriptorTypeWriter<Type>> {
|
||||
val typeContext: TypeSystemCommonBackendContextForTypeMapping
|
||||
|
||||
fun getClassInternalName(typeConstructor: TypeConstructorMarker): String
|
||||
fun getScriptInternalName(typeConstructor: TypeConstructorMarker): String
|
||||
fun Writer.writeGenericType(type: SimpleTypeMarker, asmType: Type, mode: TypeMappingMode)
|
||||
}
|
||||
|
||||
@@ -117,9 +118,7 @@ object AbstractTypeMapper {
|
||||
}
|
||||
|
||||
typeConstructor.isScript() -> {
|
||||
val asmType = AsmTypes.JAVA_CLASS_TYPE
|
||||
with(context) { sw?.writeGenericType(type, asmType, mode) }
|
||||
return asmType
|
||||
return Type.getObjectType(context.getScriptInternalName(typeConstructor))
|
||||
}
|
||||
|
||||
typeConstructor.isTypeParameter() -> {
|
||||
|
||||
@@ -265,13 +265,23 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
|
||||
);
|
||||
}
|
||||
|
||||
private static void addReifiedParametersFromSignature(@NotNull MemberCodegen member, @NotNull ClassDescriptor descriptor) {
|
||||
private static void addReifiedParametersFromSignature(@NotNull MemberCodegen<?> member, @NotNull ClassDescriptor descriptor) {
|
||||
for (KotlinType type : descriptor.getTypeConstructor().getSupertypes()) {
|
||||
for (TypeProjection supertypeArgument : type.getArguments()) {
|
||||
TypeParameterDescriptor parameterDescriptor = TypeUtils.getTypeParameterDescriptorOrNull(supertypeArgument.getType());
|
||||
if (parameterDescriptor != null && parameterDescriptor.isReified()) {
|
||||
processTypeArguments(member, type);
|
||||
}
|
||||
}
|
||||
|
||||
private static void processTypeArguments(@NotNull MemberCodegen<?> member, KotlinType type) {
|
||||
for (TypeProjection supertypeArgument : type.getArguments()) {
|
||||
if (supertypeArgument.isStarProjection()) continue;
|
||||
|
||||
TypeParameterDescriptor parameterDescriptor = TypeUtils.getTypeParameterDescriptorOrNull(supertypeArgument.getType());
|
||||
if (parameterDescriptor != null) {
|
||||
if (parameterDescriptor.isReified()) {
|
||||
member.getReifiedTypeParametersUsages().addUsedReifiedParameter(parameterDescriptor.getName().asString());
|
||||
}
|
||||
} else {
|
||||
processTypeArguments(member, supertypeArgument.getType());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,6 +188,12 @@ class JvmRuntimeTypes(
|
||||
else -> if (isMutable) mutablePropertyReferences else propertyReferences
|
||||
}
|
||||
|
||||
return classes[arity].defaultType
|
||||
return if (arity >= 0) {
|
||||
classes[arity].defaultType
|
||||
} else {
|
||||
//in case of ErrorUtils.ERROR_PROPERTY there would be no dispatchReceiverParameter and arity becomes negative
|
||||
//so we just take zero argument reference class (because it is incorrect anyway)
|
||||
classes[0].defaultType
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -650,7 +650,7 @@ class CoroutineTransformerMethodVisitor(
|
||||
|
||||
val livenessFrames = analyzeLiveness(methodNode)
|
||||
|
||||
// References shall be cleaned up after uspill (during spill in next suspension point) to prevent memory leaks,
|
||||
// References shall be cleaned up after unspill (during spill in next suspension point) to prevent memory leaks,
|
||||
val referencesToSpillBySuspensionPointIndex = arrayListOf<List<ReferenceToSpill>>()
|
||||
// while primitives shall not
|
||||
val primitivesToSpillBySuspensionPointIndex = arrayListOf<List<PrimitiveToSpill>>()
|
||||
@@ -759,6 +759,35 @@ class CoroutineTransformerMethodVisitor(
|
||||
referencesToCleanBySuspensionPointIndex += currentSpilledReferencesCount to predSpilledReferencesCount
|
||||
}
|
||||
|
||||
// Calculate debug metadata mapping before modifying method node to make it easier to locate
|
||||
// locals alive across suspension points.
|
||||
|
||||
fun calculateSpilledVariableAndField(
|
||||
suspension: SuspensionPoint,
|
||||
slot: Int,
|
||||
spillableVariable: SpillableVariable?
|
||||
): SpilledVariableAndField? {
|
||||
if (spillableVariable == null) return null
|
||||
val name = localVariableName(methodNode, slot, suspension.suspensionCallBegin.index()) ?: return null
|
||||
return SpilledVariableAndField(spillableVariable.fieldName, name)
|
||||
}
|
||||
|
||||
val spilledToVariableMapping = arrayListOf<List<SpilledVariableAndField>>()
|
||||
for (suspensionPointIndex in suspensionPoints.indices) {
|
||||
val suspension = suspensionPoints[suspensionPointIndex]
|
||||
|
||||
val spilledToVariable = arrayListOf<SpilledVariableAndField>()
|
||||
|
||||
referencesToSpillBySuspensionPointIndex[suspensionPointIndex].mapNotNullTo(spilledToVariable) { (slot, spillableVariable) ->
|
||||
calculateSpilledVariableAndField(suspension, slot, spillableVariable)
|
||||
}
|
||||
primitivesToSpillBySuspensionPointIndex[suspensionPointIndex].mapNotNullTo(spilledToVariable) { (slot, spillableVariable) ->
|
||||
calculateSpilledVariableAndField(suspension, slot, spillableVariable)
|
||||
}
|
||||
|
||||
spilledToVariableMapping += spilledToVariable
|
||||
}
|
||||
|
||||
// Mutate method node
|
||||
|
||||
fun generateSpillAndUnspill(suspension: SuspensionPoint, slot: Int, spillableVariable: SpillableVariable?) {
|
||||
@@ -772,6 +801,22 @@ class CoroutineTransformerMethodVisitor(
|
||||
return
|
||||
}
|
||||
|
||||
// Find and remove the local variable node, if any, in the local variable table corresponding to the slot that is spilled.
|
||||
var local: LocalVariableNode? = null
|
||||
val localRestart = LabelNode().linkWithLabel()
|
||||
val iterator = methodNode.localVariables.listIterator()
|
||||
while (iterator.hasNext()) {
|
||||
val node = iterator.next()
|
||||
if (node.index == slot &&
|
||||
methodNode.instructions.indexOf(node.start) <= methodNode.instructions.indexOf(suspension.suspensionCallBegin) &&
|
||||
methodNode.instructions.indexOf(node.end) > methodNode.instructions.indexOf(suspension.tryCatchBlockEndLabelAfterSuspensionCall)
|
||||
) {
|
||||
local = node
|
||||
iterator.remove()
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
with(instructions) {
|
||||
// store variable before suspension call
|
||||
insertBefore(suspension.suspensionCallBegin, withInstructionAdapter {
|
||||
@@ -795,8 +840,31 @@ class CoroutineTransformerMethodVisitor(
|
||||
)
|
||||
StackValue.coerce(spillableVariable.normalizedType, spillableVariable.type, this)
|
||||
store(slot, spillableVariable.type)
|
||||
if (local != null) {
|
||||
visitLabel(localRestart.label)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// Split the local variable range for the local so that it is visible until the next state label, but is
|
||||
// not visible until it has been unspilled from the continuation on the reentry path.
|
||||
if (local != null) {
|
||||
val previousEnd = local.end
|
||||
local.end = suspension.stateLabel
|
||||
// Add the local back, but end it at the next state label.
|
||||
methodNode.localVariables.add(local)
|
||||
// Add a new entry that starts after the local variable is restored from the continuation.
|
||||
methodNode.localVariables.add(
|
||||
LocalVariableNode(
|
||||
local.name,
|
||||
local.desc,
|
||||
local.signature,
|
||||
localRestart,
|
||||
previousEnd,
|
||||
local.index
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
fun cleanUpField(suspension: SuspensionPoint, fieldIndex: Int) {
|
||||
@@ -839,33 +907,6 @@ class CoroutineTransformerMethodVisitor(
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate debug metadata mapping
|
||||
|
||||
fun calculateSpilledVariableAndField(
|
||||
suspension: SuspensionPoint,
|
||||
slot: Int,
|
||||
spillableVariable: SpillableVariable?
|
||||
): SpilledVariableAndField? {
|
||||
if (spillableVariable == null) return null
|
||||
val name = localVariableName(methodNode, slot, suspension.suspensionCallEnd.next.index()) ?: return null
|
||||
return SpilledVariableAndField(spillableVariable.fieldName, name)
|
||||
}
|
||||
|
||||
val spilledToVariableMapping = arrayListOf<List<SpilledVariableAndField>>()
|
||||
for (suspensionPointIndex in suspensionPoints.indices) {
|
||||
val suspension = suspensionPoints[suspensionPointIndex]
|
||||
|
||||
val spilledToVariable = arrayListOf<SpilledVariableAndField>()
|
||||
|
||||
referencesToSpillBySuspensionPointIndex[suspensionPointIndex].mapNotNullTo(spilledToVariable) { (slot, spillableVariable) ->
|
||||
calculateSpilledVariableAndField(suspension, slot, spillableVariable)
|
||||
}
|
||||
primitivesToSpillBySuspensionPointIndex[suspensionPointIndex].mapNotNullTo(spilledToVariable) { (slot, spillableVariable) ->
|
||||
calculateSpilledVariableAndField(suspension, slot, spillableVariable)
|
||||
}
|
||||
|
||||
spilledToVariableMapping += spilledToVariable
|
||||
}
|
||||
return spilledToVariableMapping
|
||||
}
|
||||
|
||||
@@ -901,7 +942,6 @@ class CoroutineTransformerMethodVisitor(
|
||||
suspendMarkerVarIndex: Int,
|
||||
suspendPointLineNumber: LineNumberNode?
|
||||
): LabelNode {
|
||||
val stateLabel = LabelNode().linkWithLabel()
|
||||
val continuationLabelAfterLoadedResult = LabelNode()
|
||||
val suspendElementLineNumber = lineNumber
|
||||
var nextLineNumberNode = nextDefinitelyHitLineNumber(suspension)
|
||||
@@ -929,7 +969,7 @@ class CoroutineTransformerMethodVisitor(
|
||||
load(suspendMarkerVarIndex, AsmTypes.OBJECT_TYPE)
|
||||
areturn(AsmTypes.OBJECT_TYPE)
|
||||
// Mark place for continuation
|
||||
visitLabel(stateLabel.label)
|
||||
visitLabel(suspension.stateLabel.label)
|
||||
})
|
||||
|
||||
// After suspension point there is always three nodes: L1, NOP, L2
|
||||
@@ -985,7 +1025,7 @@ class CoroutineTransformerMethodVisitor(
|
||||
}
|
||||
}
|
||||
|
||||
return stateLabel
|
||||
return suspension.stateLabel
|
||||
}
|
||||
|
||||
// Find the next line number instruction that is defintely hit. That is, a line number
|
||||
@@ -1154,6 +1194,7 @@ internal class SuspensionPoint(
|
||||
) {
|
||||
lateinit var tryCatchBlocksContinuationLabel: LabelNode
|
||||
|
||||
val stateLabel = LabelNode().linkWithLabel()
|
||||
val unboxInlineClassInstructions: List<AbstractInsnNode> = findUnboxInlineClassInstructions()
|
||||
|
||||
private fun findUnboxInlineClassInstructions(): List<AbstractInsnNode> {
|
||||
|
||||
@@ -320,8 +320,7 @@ abstract class InlineCodegen<out T : BaseExpressionCodegen>(
|
||||
|
||||
val splitBy = SimpleInterval(start.info as LabelNode, extension.finallyIntervalEnd)
|
||||
processor.tryBlocksMetaInfo.splitAndRemoveCurrentIntervals(splitBy, true)
|
||||
|
||||
//processor.getLocalVarsMetaInfo().splitAndRemoveIntervalsFromCurrents(splitBy);
|
||||
processor.localVarsMetaInfo.splitAndRemoveCurrentIntervals(splitBy, true);
|
||||
|
||||
mark.dropTo()
|
||||
}
|
||||
@@ -330,8 +329,7 @@ abstract class InlineCodegen<out T : BaseExpressionCodegen>(
|
||||
}
|
||||
|
||||
processor.substituteTryBlockNodes(intoNode)
|
||||
|
||||
//processor.substituteLocalVarTable(intoNode);
|
||||
processor.substituteLocalVarTable(intoNode);
|
||||
}
|
||||
|
||||
protected abstract fun generateAssertFieldIfNeeded(info: RootInliningContext)
|
||||
|
||||
@@ -47,7 +47,9 @@ abstract class LambdaInfo(@JvmField val isCrossInline: Boolean) : FunctionalArgu
|
||||
|
||||
abstract val invokeMethod: Method
|
||||
|
||||
abstract val invokeMethodDescriptor: FunctionDescriptor
|
||||
abstract val invokeMethodParameters: List<KotlinType?>
|
||||
|
||||
abstract val invokeMethodReturnType: KotlinType?
|
||||
|
||||
abstract val capturedVars: List<CapturedParamDesc>
|
||||
|
||||
@@ -98,14 +100,16 @@ class PsiDefaultLambda(
|
||||
offset: Int,
|
||||
needReification: Boolean
|
||||
) : DefaultLambda(lambdaClassType, capturedArgs, parameterDescriptor, offset, needReification) {
|
||||
override fun mapAsmSignature(sourceCompiler: SourceCompilerForInline): Method {
|
||||
return sourceCompiler.state.typeMapper.mapSignatureSkipGeneric(invokeMethodDescriptor).asmMethod
|
||||
}
|
||||
override fun mapAsmSignature(sourceCompiler: SourceCompilerForInline, descriptor: FunctionDescriptor): Method =
|
||||
sourceCompiler.state.typeMapper.mapSignatureSkipGeneric(descriptor).asmMethod
|
||||
|
||||
override fun findInvokeMethodDescriptor(): FunctionDescriptor =
|
||||
override fun findInvokeMethodDescriptor(isPropertyReference: Boolean): FunctionDescriptor =
|
||||
parameterDescriptor.type.memberScope
|
||||
.getContributedFunctions(OperatorNameConventions.INVOKE, NoLookupLocation.FROM_BACKEND)
|
||||
.single()
|
||||
.single().let {
|
||||
// property reference generates erased 'get' method
|
||||
if (isPropertyReference) it.original else it
|
||||
}
|
||||
}
|
||||
|
||||
abstract class DefaultLambda(
|
||||
@@ -124,7 +128,13 @@ abstract class DefaultLambda(
|
||||
final override lateinit var invokeMethod: Method
|
||||
private set
|
||||
|
||||
override lateinit var invokeMethodDescriptor: FunctionDescriptor
|
||||
private lateinit var invokeMethodDescriptor: FunctionDescriptor
|
||||
|
||||
override val invokeMethodParameters: List<KotlinType?>
|
||||
get() = invokeMethodDescriptor.valueParameters.map { it.returnType } // should be FunctionN, so no extension receiver
|
||||
|
||||
override val invokeMethodReturnType: KotlinType?
|
||||
get() = invokeMethodDescriptor.returnType
|
||||
|
||||
final override lateinit var capturedVars: List<CapturedParamDesc>
|
||||
private set
|
||||
@@ -155,10 +165,7 @@ abstract class DefaultLambda(
|
||||
}
|
||||
}, ClassReader.SKIP_CODE or ClassReader.SKIP_FRAMES or ClassReader.SKIP_DEBUG)
|
||||
|
||||
invokeMethodDescriptor = findInvokeMethodDescriptor().let {
|
||||
//property reference generates erased 'get' method
|
||||
if (isPropertyReference) it.original else it
|
||||
}
|
||||
invokeMethodDescriptor = findInvokeMethodDescriptor(isPropertyReference)
|
||||
|
||||
val descriptor = Type.getMethodDescriptor(Type.VOID_TYPE, *capturedArgs)
|
||||
val constructor = getMethodNode(classBytes, "<init>", descriptor, lambdaClassType)?.node
|
||||
@@ -182,7 +189,7 @@ abstract class DefaultLambda(
|
||||
|
||||
val methodName = (if (isPropertyReference) OperatorNameConventions.GET else OperatorNameConventions.INVOKE).asString()
|
||||
|
||||
val signature = mapAsmSignature(sourceCompiler)
|
||||
val signature = mapAsmSignature(sourceCompiler, invokeMethodDescriptor)
|
||||
|
||||
node = getMethodNode(classBytes, methodName, signature.descriptor, lambdaClassType, signatureAmbiguity = true)
|
||||
?: error("Can't find method '$methodName$signature' in '${classReader.className}'")
|
||||
@@ -195,9 +202,10 @@ abstract class DefaultLambda(
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract fun mapAsmSignature(sourceCompiler: SourceCompilerForInline): Method
|
||||
protected abstract fun mapAsmSignature(sourceCompiler: SourceCompilerForInline, descriptor: FunctionDescriptor): Method
|
||||
|
||||
protected abstract fun findInvokeMethodDescriptor(): FunctionDescriptor
|
||||
// TODO: get rid of this; descriptors should *only* be used by PsiDefaultLambda
|
||||
protected abstract fun findInvokeMethodDescriptor(isPropertyReference: Boolean): FunctionDescriptor
|
||||
|
||||
private companion object {
|
||||
val PROPERTY_REFERENCE_SUPER_CLASSES =
|
||||
@@ -221,7 +229,6 @@ abstract class ExpressionLambda(isCrossInline: Boolean) : LambdaInfo(isCrossInli
|
||||
node.node.preprocessSuspendMarkers(forInline = true, keepFakeContinuation = false)
|
||||
}
|
||||
|
||||
abstract fun getInlineSuspendLambdaViewDescriptor(): FunctionDescriptor
|
||||
abstract fun isCapturedSuspend(desc: CapturedParamDesc): Boolean
|
||||
}
|
||||
|
||||
@@ -237,7 +244,24 @@ class PsiExpressionLambda(
|
||||
|
||||
override val invokeMethod: Method
|
||||
|
||||
override val invokeMethodDescriptor: FunctionDescriptor
|
||||
val invokeMethodDescriptor: FunctionDescriptor
|
||||
|
||||
override val invokeMethodParameters: List<KotlinType?>
|
||||
get() {
|
||||
val actualInvokeDescriptor = if (isSuspend)
|
||||
getOrCreateJvmSuspendFunctionView(
|
||||
invokeMethodDescriptor,
|
||||
languageVersionSettings.isReleaseCoroutines(),
|
||||
typeMapper.bindingContext
|
||||
)
|
||||
else
|
||||
invokeMethodDescriptor
|
||||
val valueParameters = actualInvokeDescriptor.valueParameters.map { it.returnType }
|
||||
return actualInvokeDescriptor.extensionReceiverParameter?.let { listOf(it.returnType) + valueParameters } ?: valueParameters
|
||||
}
|
||||
|
||||
override val invokeMethodReturnType: KotlinType?
|
||||
get() = invokeMethodDescriptor.returnType
|
||||
|
||||
val classDescriptor: ClassDescriptor
|
||||
|
||||
@@ -325,14 +349,6 @@ class PsiExpressionLambda(
|
||||
val isPropertyReference: Boolean
|
||||
get() = propertyReferenceInfo != null
|
||||
|
||||
override fun getInlineSuspendLambdaViewDescriptor(): FunctionDescriptor {
|
||||
return getOrCreateJvmSuspendFunctionView(
|
||||
invokeMethodDescriptor,
|
||||
languageVersionSettings.isReleaseCoroutines(),
|
||||
typeMapper.bindingContext
|
||||
)
|
||||
}
|
||||
|
||||
override fun isCapturedSuspend(desc: CapturedParamDesc): Boolean =
|
||||
isCapturedSuspendLambda(closure, desc.fieldName, typeMapper.bindingContext)
|
||||
}
|
||||
|
||||
@@ -23,13 +23,13 @@ import org.jetbrains.kotlin.codegen.optimization.fixStack.top
|
||||
import org.jetbrains.kotlin.codegen.optimization.nullCheck.isCheckParameterIsNotNull
|
||||
import org.jetbrains.kotlin.codegen.pseudoInsns.PseudoInsn
|
||||
import org.jetbrains.kotlin.config.LanguageFeature
|
||||
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.ParameterDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
|
||||
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
|
||||
import org.jetbrains.kotlin.load.java.JvmAbi
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
|
||||
import org.jetbrains.kotlin.resolve.jvm.AsmTypes
|
||||
import org.jetbrains.kotlin.resolve.jvm.AsmTypes.OBJECT_TYPE
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.util.OperatorNameConventions
|
||||
import org.jetbrains.kotlin.utils.SmartList
|
||||
import org.jetbrains.kotlin.utils.SmartSet
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
@@ -233,38 +233,24 @@ class MethodInliner(
|
||||
return
|
||||
}
|
||||
|
||||
// in case of inlining suspend lambda reference as ordinary parameter of inline function:
|
||||
// suspend fun foo (...) ...
|
||||
// inline fun inlineMe(c: (...) -> ...) ...
|
||||
// builder {
|
||||
// inlineMe(::foo)
|
||||
// }
|
||||
// we should create additional parameter for continuation.
|
||||
val valueParameters = info.invokeMethodParameters
|
||||
// If suspend lambda has no continuation at the end, add it here. (In the IR backend, suspend lambdas
|
||||
// always come pre-lowered with the continuation parameter.)
|
||||
var coroutineDesc = desc
|
||||
val actualInvokeDescriptor: FunctionDescriptor
|
||||
if (info.isSuspend) {
|
||||
actualInvokeDescriptor = (info as ExpressionLambda).getInlineSuspendLambdaViewDescriptor()
|
||||
val parametersSize = actualInvokeDescriptor.valueParameters.size +
|
||||
(if (actualInvokeDescriptor.extensionReceiverParameter != null) 1 else 0)
|
||||
// And here we expect invoke(...Ljava/lang/Object;) be replaced with invoke(...Lkotlin/coroutines/Continuation;)
|
||||
// if this does not happen, insert fake continuation, since we could not have one yet.
|
||||
if (!inliningContext.root.state.isIrBackend && info.isSuspend) {
|
||||
val argumentTypes = Type.getArgumentTypes(desc)
|
||||
if (argumentTypes.size != parametersSize &&
|
||||
// But do not add it in IR. In IR we already have lowered lambdas with additional parameter, while in Old BE we don't.
|
||||
!inliningContext.root.state.isIrBackend
|
||||
) {
|
||||
if (argumentTypes.size != valueParameters.size) {
|
||||
addFakeContinuationMarker(this)
|
||||
coroutineDesc = Type.getMethodDescriptor(Type.getReturnType(desc), *argumentTypes, AsmTypes.OBJECT_TYPE)
|
||||
}
|
||||
} else {
|
||||
actualInvokeDescriptor = info.invokeMethodDescriptor
|
||||
}
|
||||
|
||||
val valueParameters =
|
||||
listOfNotNull(actualInvokeDescriptor.extensionReceiverParameter) + actualInvokeDescriptor.valueParameters
|
||||
|
||||
val erasedInvokeFunction = ClosureCodegen.getErasedInvokeFunction(actualInvokeDescriptor)
|
||||
val invokeParameters = erasedInvokeFunction.valueParameters
|
||||
// TODO: this is a weird way to get N instances of `Any?`
|
||||
val moduleBuiltIns = inliningContext.root.sourceCompilerForInline.compilationContextDescriptor.builtIns
|
||||
val erasedFunctionType = moduleBuiltIns.getFunction(valueParameters.size).defaultType
|
||||
val erasedInvokeFunction = erasedFunctionType.memberScope
|
||||
.getContributedFunctions(OperatorNameConventions.INVOKE, NoLookupLocation.FROM_BACKEND).first()
|
||||
val invokeParameters = erasedInvokeFunction.valueParameters.map { it.returnType }
|
||||
|
||||
val valueParamShift = max(nextLocalIndex, markerShift)//NB: don't inline cause it changes
|
||||
val parameterTypesFromDesc = info.invokeMethod.argumentTypes
|
||||
@@ -305,7 +291,7 @@ class MethodInliner(
|
||||
result.reifiedTypeParametersUsages.mergeAll(lambdaResult.reifiedTypeParametersUsages)
|
||||
|
||||
StackValue
|
||||
.onStack(info.invokeMethod.returnType, info.invokeMethodDescriptor.returnType)
|
||||
.onStack(info.invokeMethod.returnType, info.invokeMethodReturnType)
|
||||
.put(OBJECT_TYPE, erasedInvokeFunction.returnType, this)
|
||||
setLambdaInlining(false)
|
||||
addInlineMarker(this, false)
|
||||
@@ -1075,8 +1061,8 @@ class MethodInliner(
|
||||
|
||||
private fun putStackValuesIntoLocalsForLambdaOnInvoke(
|
||||
directOrder: List<Type>,
|
||||
directOrderOfArguments: List<ParameterDescriptor>,
|
||||
directOrderOfInvokeParameters: List<ValueParameterDescriptor>,
|
||||
directOrderOfArguments: List<KotlinType?>,
|
||||
directOrderOfInvokeParameters: List<KotlinType?>,
|
||||
shift: Int,
|
||||
iv: InstructionAdapter,
|
||||
descriptor: String
|
||||
@@ -1099,8 +1085,8 @@ class MethodInliner(
|
||||
val argumentKotlinType: KotlinType?
|
||||
val invokeParameterKotlinType: KotlinType?
|
||||
if (safeToUseArgumentKotlinType) {
|
||||
argumentKotlinType = directOrderOfArguments[index].type
|
||||
invokeParameterKotlinType = directOrderOfInvokeParameters[index].type
|
||||
argumentKotlinType = directOrderOfArguments[index]
|
||||
invokeParameterKotlinType = directOrderOfInvokeParameters[index]
|
||||
} else {
|
||||
argumentKotlinType = null
|
||||
invokeParameterKotlinType = null
|
||||
|
||||
@@ -18,12 +18,16 @@ package org.jetbrains.kotlin.codegen.optimization.boxing
|
||||
|
||||
import com.google.common.collect.ImmutableSet
|
||||
import org.jetbrains.kotlin.codegen.AsmUtil
|
||||
import org.jetbrains.kotlin.codegen.coroutines.RELEASE_COROUTINES_VERSION_SETTINGS
|
||||
import org.jetbrains.kotlin.codegen.coroutines.coroutinesJvmInternalPackageFqName
|
||||
import org.jetbrains.kotlin.codegen.intrinsics.IntrinsicMethods
|
||||
import org.jetbrains.kotlin.codegen.optimization.common.OptimizationBasicInterpreter
|
||||
import org.jetbrains.kotlin.codegen.optimization.common.StrictBasicValue
|
||||
import org.jetbrains.kotlin.codegen.state.GenerationState
|
||||
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper
|
||||
import org.jetbrains.kotlin.codegen.topLevelClassInternalName
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.jvm.AsmTypes
|
||||
import org.jetbrains.kotlin.resolve.jvm.JvmPrimitiveType
|
||||
import org.jetbrains.org.objectweb.asm.Opcodes
|
||||
@@ -174,7 +178,7 @@ fun AbstractInsnNode.isUnboxing(state: GenerationState) =
|
||||
isPrimitiveUnboxing() || isJavaLangClassUnboxing() || isInlineClassUnboxing(state)
|
||||
|
||||
fun AbstractInsnNode.isBoxing(state: GenerationState) =
|
||||
isPrimitiveBoxing() || isJavaLangClassBoxing() || isInlineClassBoxing(state)
|
||||
isPrimitiveBoxing() || isJavaLangClassBoxing() || isInlineClassBoxing(state) || isCoroutinePrimitiveBoxing()
|
||||
|
||||
fun AbstractInsnNode.isPrimitiveUnboxing() =
|
||||
isMethodInsnWith(Opcodes.INVOKEVIRTUAL) {
|
||||
@@ -211,6 +215,19 @@ fun AbstractInsnNode.isPrimitiveBoxing() =
|
||||
isBoxingMethodDescriptor()
|
||||
}
|
||||
|
||||
private val BOXING_CLASS_INTERNAL_NAME =
|
||||
RELEASE_COROUTINES_VERSION_SETTINGS.coroutinesJvmInternalPackageFqName().child(Name.identifier("Boxing")).topLevelClassInternalName()
|
||||
|
||||
private fun isJvmPrimitiveName(name: String) = JvmPrimitiveType.values().any { it.javaKeywordName == name }
|
||||
|
||||
fun AbstractInsnNode.isCoroutinePrimitiveBoxing(): Boolean {
|
||||
return isMethodInsnWith(Opcodes.INVOKESTATIC) {
|
||||
owner == BOXING_CLASS_INTERNAL_NAME &&
|
||||
name.startsWith("box") &&
|
||||
isJvmPrimitiveName(name.substring(3).lowercase())
|
||||
}
|
||||
}
|
||||
|
||||
private fun MethodInsnNode.isBoxingMethodDescriptor(): Boolean {
|
||||
val ownerType = Type.getObjectType(owner)
|
||||
return desc == Type.getMethodDescriptor(ownerType, AsmUtil.unboxType(ownerType))
|
||||
|
||||
@@ -39,7 +39,7 @@ class RedundantBoxingMethodTransformer(private val generationState: GenerationSt
|
||||
|
||||
override fun transform(internalClassName: String, node: MethodNode) {
|
||||
val interpreter = RedundantBoxingInterpreter(node.instructions, generationState)
|
||||
val frames = MethodTransformer.analyze(internalClassName, node, interpreter)
|
||||
val frames = analyze(internalClassName, node, interpreter)
|
||||
|
||||
interpretPopInstructionsForBoxedValues(interpreter, node, frames)
|
||||
|
||||
@@ -168,7 +168,8 @@ class RedundantBoxingMethodTransformer(private val generationState: GenerationSt
|
||||
val frame = frames[i] ?: continue
|
||||
val insn = insnList[i]
|
||||
if ((insn.opcode == Opcodes.ASTORE || insn.opcode == Opcodes.ALOAD) &&
|
||||
(insn as VarInsnNode).`var` == localVariableNode.index) {
|
||||
(insn as VarInsnNode).`var` == localVariableNode.index
|
||||
) {
|
||||
if (insn.getOpcode() == Opcodes.ASTORE) {
|
||||
values.add(frame.top()!!)
|
||||
} else {
|
||||
|
||||
@@ -377,7 +377,7 @@ class K2JVMCompilerArguments : CommonCompilerArguments() {
|
||||
default: `indy-with-constants` for JVM target 9 or greater, `inline` otherwise"""
|
||||
|
||||
)
|
||||
var stringConcat: String? by NullableStringFreezableVar(JvmStringConcat.INLINE.description)
|
||||
var stringConcat: String? by NullableStringFreezableVar(null)
|
||||
|
||||
@Argument(
|
||||
value = "-Xsam-conversions",
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.intellij.openapi.vfs.VirtualFile
|
||||
import com.intellij.psi.PsiJavaModule
|
||||
import com.intellij.psi.PsiManager
|
||||
import com.intellij.psi.impl.light.LightJavaModule
|
||||
import com.intellij.psi.search.GlobalSearchScope
|
||||
import org.jetbrains.kotlin.cli.common.config.ContentRoot
|
||||
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation
|
||||
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
|
||||
@@ -37,6 +38,7 @@ import org.jetbrains.kotlin.cli.jvm.modules.CliJavaModuleFinder
|
||||
import org.jetbrains.kotlin.cli.jvm.modules.JavaModuleGraph
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.isValidJavaFqName
|
||||
import org.jetbrains.kotlin.resolve.jvm.KotlinCliJavaFileManager
|
||||
import org.jetbrains.kotlin.resolve.jvm.modules.JavaModule
|
||||
import org.jetbrains.kotlin.resolve.jvm.modules.JavaModuleInfo
|
||||
import org.jetbrains.kotlin.resolve.jvm.modules.KOTLIN_STDLIB_MODULE_NAME
|
||||
@@ -52,10 +54,13 @@ class ClasspathRootsResolver(
|
||||
private val contentRootToVirtualFile: (JvmContentRoot) -> VirtualFile?,
|
||||
private val javaModuleFinder: CliJavaModuleFinder,
|
||||
private val requireStdlibModule: Boolean,
|
||||
private val outputDirectory: VirtualFile?
|
||||
private val outputDirectory: VirtualFile?,
|
||||
private val javaFileManager: KotlinCliJavaFileManager
|
||||
) {
|
||||
val javaModuleGraph = JavaModuleGraph(javaModuleFinder)
|
||||
|
||||
private val searchScope = GlobalSearchScope.allScope(psiManager.project)
|
||||
|
||||
data class RootsAndModules(val roots: List<JavaRoot>, val modules: List<JavaModule>)
|
||||
|
||||
private data class RootWithPrefix(val root: VirtualFile, val packagePrefix: String?)
|
||||
@@ -160,7 +165,7 @@ class ClasspathRootsResolver(
|
||||
}
|
||||
|
||||
if (moduleInfoFile != null) {
|
||||
val moduleInfo = JavaModuleInfo.read(moduleInfoFile) ?: return null
|
||||
val moduleInfo = JavaModuleInfo.read(moduleInfoFile, javaFileManager, searchScope) ?: return null
|
||||
return JavaModule.Explicit(moduleInfo, listOf(JavaModule.Root(root, isBinary = true)), moduleInfoFile)
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class CliKotlinAsJavaSupport(
|
||||
return findFacadeFilesInPackage(packageFqName, scope)
|
||||
.groupBy { it.javaFileFacadeFqName }
|
||||
.mapNotNull { (facadeClassFqName, _) ->
|
||||
KtLightClassForFacade.createForFacade(psiManager, facadeClassFqName, scope)
|
||||
KtLightClassForFacadeImpl.createForFacade(psiManager, facadeClassFqName, scope)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ class CliKotlinAsJavaSupport(
|
||||
.orEmpty()
|
||||
|
||||
override fun getFacadeClasses(facadeFqName: FqName, scope: GlobalSearchScope): Collection<PsiClass> {
|
||||
return listOfNotNull(KtLightClassForFacade.createForFacade(psiManager, facadeFqName, scope))
|
||||
return listOfNotNull(KtLightClassForFacadeImpl.createForFacade(psiManager, facadeFqName, scope))
|
||||
}
|
||||
|
||||
override fun getScriptClasses(scriptFqName: FqName, scope: GlobalSearchScope): Collection<PsiClass> {
|
||||
|
||||
@@ -35,6 +35,10 @@ class CliVirtualFileFinder(
|
||||
override fun findVirtualFileWithHeader(classId: ClassId): VirtualFile? =
|
||||
findBinaryClass(classId, classId.relativeClassName.asString().replace('.', '$') + ".class")
|
||||
|
||||
override fun findSourceOrBinaryVirtualFile(classId: ClassId) =
|
||||
findBinaryClass(classId, classId.relativeClassName.asString().replace('.', '$') + ".class")
|
||||
?: findSourceClass(classId, classId.relativeClassName.asString() + ".java")
|
||||
|
||||
override fun findMetadata(classId: ClassId): InputStream? {
|
||||
assert(!classId.isNestedClass) { "Nested classes are not supported here: $classId" }
|
||||
|
||||
@@ -61,8 +65,11 @@ class CliVirtualFileFinder(
|
||||
return findBinaryClass(classId, BuiltInSerializerProtocol.getBuiltInsFileName(packageFqName))?.inputStream
|
||||
}
|
||||
|
||||
private fun findBinaryClass(classId: ClassId, fileName: String): VirtualFile? =
|
||||
index.findClass(classId, acceptedRootTypes = JavaRoot.OnlyBinary) { dir, _ ->
|
||||
private fun findClass(classId: ClassId, fileName: String, rootType: Set<JavaRoot.RootType>) =
|
||||
index.findClass(classId, acceptedRootTypes = rootType) { dir, _ ->
|
||||
dir.findChild(fileName)?.takeIf(VirtualFile::isValid)
|
||||
}?.takeIf { it in scope }
|
||||
|
||||
private fun findBinaryClass(classId: ClassId, fileName: String) = findClass(classId, fileName, JavaRoot.OnlyBinary)
|
||||
private fun findSourceClass(classId: ClassId, fileName: String) = findClass(classId, fileName, JavaRoot.OnlySource)
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ class KotlinCliJavaFileManagerImpl(private val myPsiManager: PsiManager) : CoreJ
|
||||
private val binaryCache: MutableMap<ClassId, JavaClass?> = THashMap()
|
||||
private val signatureParsingComponent = BinaryClassSignatureParser()
|
||||
|
||||
fun findClass(classId: ClassId, searchScope: GlobalSearchScope): JavaClass? = findClass(JavaClassFinder.Request(classId), searchScope)
|
||||
fun findClass(classId: ClassId, searchScope: GlobalSearchScope) = findClass(JavaClassFinder.Request(classId), searchScope)
|
||||
|
||||
override fun findClass(request: JavaClassFinder.Request, searchScope: GlobalSearchScope): JavaClass? {
|
||||
val (classId, classFileContentFromRequest, outerClassFromRequest) = request
|
||||
|
||||
@@ -190,11 +190,17 @@ class KotlinCoreEnvironment private constructor(
|
||||
|
||||
sourceFiles.sortBy { it.virtualFile.path }
|
||||
|
||||
val javaFileManager = ServiceManager.getService(project, CoreJavaFileManager::class.java) as KotlinCliJavaFileManagerImpl
|
||||
|
||||
val jdkHome = configuration.get(JVMConfigurationKeys.JDK_HOME)
|
||||
val jrtFileSystem = VirtualFileManager.getInstance().getFileSystem(StandardFileSystems.JRT_PROTOCOL)
|
||||
val javaModuleFinder = CliJavaModuleFinder(jdkHome?.path?.let { path ->
|
||||
jrtFileSystem?.findFileByPath(path + URLUtil.JAR_SEPARATOR)
|
||||
})
|
||||
val javaModuleFinder = CliJavaModuleFinder(
|
||||
jdkHome?.path?.let { path ->
|
||||
jrtFileSystem?.findFileByPath(path + URLUtil.JAR_SEPARATOR)
|
||||
},
|
||||
javaFileManager,
|
||||
project
|
||||
)
|
||||
|
||||
val outputDirectory =
|
||||
configuration.get(JVMConfigurationKeys.MODULES)?.singleOrNull()?.getOutputDirectory()
|
||||
@@ -207,7 +213,8 @@ class KotlinCoreEnvironment private constructor(
|
||||
this::contentRootToVirtualFile,
|
||||
javaModuleFinder,
|
||||
!configuration.getBoolean(CLIConfigurationKeys.ALLOW_KOTLIN_PACKAGE),
|
||||
outputDirectory?.let(this::findLocalFile)
|
||||
outputDirectory?.let(this::findLocalFile),
|
||||
javaFileManager
|
||||
)
|
||||
|
||||
val (initialRoots, javaModules) =
|
||||
@@ -231,7 +238,7 @@ class KotlinCoreEnvironment private constructor(
|
||||
updateClasspathFromRootsIndex(this)
|
||||
}
|
||||
|
||||
(ServiceManager.getService(project, CoreJavaFileManager::class.java) as KotlinCliJavaFileManagerImpl).initialize(
|
||||
javaFileManager.initialize(
|
||||
rootsIndex,
|
||||
packagePartProviders,
|
||||
SingleJavaFileRootsIndex(singleJavaFileRoots),
|
||||
@@ -240,7 +247,7 @@ class KotlinCoreEnvironment private constructor(
|
||||
|
||||
project.registerService(
|
||||
JavaModuleResolver::class.java,
|
||||
CliJavaModuleResolver(classpathRootsResolver.javaModuleGraph, javaModules, javaModuleFinder.systemModules.toList())
|
||||
CliJavaModuleResolver(classpathRootsResolver.javaModuleGraph, javaModules, javaModuleFinder.systemModules.toList(), project)
|
||||
)
|
||||
|
||||
val finderFactory = CliVirtualFileFinderFactory(rootsIndex)
|
||||
|
||||
@@ -78,10 +78,7 @@ import org.jetbrains.kotlin.cli.jvm.modules.CoreJrtFileSystem
|
||||
import org.jetbrains.kotlin.codegen.extensions.ClassBuilderInterceptorExtension
|
||||
import org.jetbrains.kotlin.codegen.extensions.ExpressionCodegenExtension
|
||||
import org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
|
||||
import org.jetbrains.kotlin.config.APPEND_JAVA_SOURCE_ROOTS_HANDLER_KEY
|
||||
import org.jetbrains.kotlin.config.CompilerConfiguration
|
||||
import org.jetbrains.kotlin.config.JVMConfigurationKeys
|
||||
import org.jetbrains.kotlin.config.languageVersionSettings
|
||||
import org.jetbrains.kotlin.config.*
|
||||
import org.jetbrains.kotlin.extensions.*
|
||||
import org.jetbrains.kotlin.extensions.internal.CandidateInterceptor
|
||||
import org.jetbrains.kotlin.extensions.internal.TypeResolutionInterceptor
|
||||
@@ -193,11 +190,16 @@ class KotlinCoreEnvironment private constructor(
|
||||
|
||||
sourceFiles.sortBy { it.virtualFile.path }
|
||||
|
||||
val javaFileManager = ServiceManager.getService(project, CoreJavaFileManager::class.java) as KotlinCliJavaFileManagerImpl
|
||||
|
||||
val jdkHome = configuration.get(JVMConfigurationKeys.JDK_HOME)
|
||||
val jrtFileSystem = VirtualFileManager.getInstance().getFileSystem(StandardFileSystems.JRT_PROTOCOL)
|
||||
val javaModuleFinder = CliJavaModuleFinder(jdkHome?.path?.let { path ->
|
||||
jrtFileSystem?.findFileByPath(path + URLUtil.JAR_SEPARATOR)
|
||||
})
|
||||
val javaModuleFinder = CliJavaModuleFinder(
|
||||
jdkHome?.path?.let { path ->
|
||||
jrtFileSystem?.findFileByPath(path + URLUtil.JAR_SEPARATOR)
|
||||
},
|
||||
javaFileManager
|
||||
)
|
||||
|
||||
val outputDirectory =
|
||||
configuration.get(JVMConfigurationKeys.MODULES)?.singleOrNull()?.getOutputDirectory()
|
||||
@@ -210,7 +212,8 @@ class KotlinCoreEnvironment private constructor(
|
||||
this::contentRootToVirtualFile,
|
||||
javaModuleFinder,
|
||||
!configuration.getBoolean(CLIConfigurationKeys.ALLOW_KOTLIN_PACKAGE),
|
||||
outputDirectory?.let(this::findLocalFile)
|
||||
outputDirectory?.let(this::findLocalFile),
|
||||
javaFileManager
|
||||
)
|
||||
|
||||
val (initialRoots, javaModules) =
|
||||
@@ -234,7 +237,7 @@ class KotlinCoreEnvironment private constructor(
|
||||
updateClasspathFromRootsIndex(this)
|
||||
}
|
||||
|
||||
(ServiceManager.getService(project, CoreJavaFileManager::class.java) as KotlinCliJavaFileManagerImpl).initialize(
|
||||
javaFileManager.initialize(
|
||||
rootsIndex,
|
||||
packagePartProviders,
|
||||
SingleJavaFileRootsIndex(singleJavaFileRoots),
|
||||
@@ -243,7 +246,7 @@ class KotlinCoreEnvironment private constructor(
|
||||
|
||||
project.registerService(
|
||||
JavaModuleResolver::class.java,
|
||||
CliJavaModuleResolver(classpathRootsResolver.javaModuleGraph, javaModules, javaModuleFinder.systemModules.toList())
|
||||
CliJavaModuleResolver(classpathRootsResolver.javaModuleGraph, javaModules, javaModuleFinder.systemModules.toList(), project)
|
||||
)
|
||||
|
||||
val finderFactory = CliVirtualFileFinderFactory(rootsIndex)
|
||||
|
||||
@@ -49,6 +49,9 @@ fun CompilerConfiguration.addJvmSdkRoots(files: List<File>) {
|
||||
val CompilerConfiguration.jvmClasspathRoots: List<File>
|
||||
get() = getList(CLIConfigurationKeys.CONTENT_ROOTS).filterIsInstance<JvmClasspathRoot>().map(JvmContentRoot::file)
|
||||
|
||||
val CompilerConfiguration.jvmModularRoots: List<File>
|
||||
get() = getList(CLIConfigurationKeys.CONTENT_ROOTS).filterIsInstance<JvmModulePathRoot>().map(JvmContentRoot::file)
|
||||
|
||||
@JvmOverloads
|
||||
fun CompilerConfiguration.addJavaSourceRoot(file: File, packagePrefix: String? = null) {
|
||||
add(CLIConfigurationKeys.CONTENT_ROOTS, JavaSourceRoot(file, packagePrefix))
|
||||
|
||||
@@ -45,6 +45,7 @@ data class JavaRoot(val file: VirtualFile, val type: RootType, val prefixFqName:
|
||||
|
||||
companion object RootTypes {
|
||||
val OnlyBinary: Set<RootType> = EnumSet.of(RootType.BINARY)
|
||||
val OnlySource: Set<RootType> = EnumSet.of(RootType.SOURCE)
|
||||
val SourceAndBinary: Set<RootType> = EnumSet.of(RootType.BINARY, RootType.SOURCE)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,19 +54,20 @@ fun CompilerConfiguration.setupJvmSpecificArguments(arguments: K2JVMCompilerArgu
|
||||
}
|
||||
}
|
||||
|
||||
if (arguments.stringConcat != null) {
|
||||
val runtimeStringConcat = JvmStringConcat.fromString(arguments.stringConcat!!)
|
||||
val stringConcat = arguments.stringConcat
|
||||
if (stringConcat != null) {
|
||||
val runtimeStringConcat = JvmStringConcat.fromString(stringConcat)
|
||||
if (runtimeStringConcat != null) {
|
||||
put(JVMConfigurationKeys.STRING_CONCAT, runtimeStringConcat)
|
||||
if (jvmTarget.majorVersion < JvmTarget.JVM_9.majorVersion && runtimeStringConcat != JvmStringConcat.INLINE) {
|
||||
messageCollector.report(
|
||||
WARNING,
|
||||
"`-Xstring-concat=${arguments.stringConcat}` does nothing with JVM target `${jvmTarget.description}`."
|
||||
"`-Xstring-concat=$stringConcat` does nothing with JVM target `${jvmTarget.description}`."
|
||||
)
|
||||
}
|
||||
} else {
|
||||
messageCollector.report(
|
||||
ERROR, "Unknown `-Xstring-concat` mode: ${arguments.stringConcat}\n" +
|
||||
ERROR, "Unknown `-Xstring-concat` mode: $stringConcat\n" +
|
||||
"Supported modes: ${JvmStringConcat.values().joinToString { it.description }}"
|
||||
)
|
||||
}
|
||||
|
||||
@@ -16,16 +16,25 @@
|
||||
|
||||
package org.jetbrains.kotlin.cli.jvm.modules
|
||||
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
import com.intellij.psi.PsiJavaModule
|
||||
import com.intellij.psi.search.GlobalSearchScope
|
||||
import org.jetbrains.kotlin.resolve.jvm.KotlinCliJavaFileManager
|
||||
import org.jetbrains.kotlin.resolve.jvm.modules.JavaModule
|
||||
import org.jetbrains.kotlin.resolve.jvm.modules.JavaModuleFinder
|
||||
import org.jetbrains.kotlin.resolve.jvm.modules.JavaModuleInfo
|
||||
|
||||
class CliJavaModuleFinder(jrtFileSystemRoot: VirtualFile?) : JavaModuleFinder {
|
||||
class CliJavaModuleFinder(
|
||||
jrtFileSystemRoot: VirtualFile?,
|
||||
private val javaFileManager: KotlinCliJavaFileManager,
|
||||
project: Project
|
||||
) : JavaModuleFinder {
|
||||
private val modulesRoot = jrtFileSystemRoot?.findChild("modules")
|
||||
private val userModules = linkedMapOf<String, JavaModule>()
|
||||
|
||||
private val allScope = GlobalSearchScope.allScope(project)
|
||||
|
||||
fun addUserModule(module: JavaModule) {
|
||||
userModules.putIfAbsent(module.name, module)
|
||||
}
|
||||
@@ -41,7 +50,7 @@ class CliJavaModuleFinder(jrtFileSystemRoot: VirtualFile?) : JavaModuleFinder {
|
||||
|
||||
private fun findSystemModule(moduleRoot: VirtualFile): JavaModule.Explicit? {
|
||||
val file = moduleRoot.findChild(PsiJavaModule.MODULE_INFO_CLS_FILE) ?: return null
|
||||
val moduleInfo = JavaModuleInfo.read(file) ?: return null
|
||||
val moduleInfo = JavaModuleInfo.read(file, javaFileManager, allScope) ?: return null
|
||||
return JavaModule.Explicit(moduleInfo, listOf(JavaModule.Root(moduleRoot, isBinary = true)), file)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,18 +18,24 @@ package org.jetbrains.kotlin.cli.jvm.modules
|
||||
|
||||
import com.intellij.ide.highlighter.JavaClassFileType
|
||||
import com.intellij.ide.highlighter.JavaFileType
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.vfs.StandardFileSystems
|
||||
import com.intellij.openapi.vfs.VfsUtilCore
|
||||
import com.intellij.openapi.vfs.VirtualFile
|
||||
import org.jetbrains.kotlin.idea.KotlinFileType
|
||||
import org.jetbrains.kotlin.load.java.structure.JavaAnnotation
|
||||
import org.jetbrains.kotlin.load.kotlin.VirtualFileFinder
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.resolve.jvm.modules.JavaModule
|
||||
import org.jetbrains.kotlin.resolve.jvm.modules.JavaModuleResolver
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
class CliJavaModuleResolver(
|
||||
private val moduleGraph: JavaModuleGraph,
|
||||
private val userModules: List<JavaModule>,
|
||||
private val systemModules: List<JavaModule.Explicit>
|
||||
private val systemModules: List<JavaModule.Explicit>,
|
||||
private val project: Project
|
||||
) : JavaModuleResolver {
|
||||
init {
|
||||
assert(userModules.count(JavaModule::isSourceModule) <= 1) {
|
||||
@@ -37,6 +43,14 @@ class CliJavaModuleResolver(
|
||||
}
|
||||
}
|
||||
|
||||
private val virtualFileFinder by lazy { VirtualFileFinder.getInstance(project) }
|
||||
|
||||
override fun getAnnotationsForModuleOwnerOfClass(classId: ClassId): List<JavaAnnotation>? {
|
||||
val virtualFile = virtualFileFinder.findSourceOrBinaryVirtualFile(classId) ?: return null
|
||||
|
||||
return (findJavaModule(virtualFile) as? JavaModule.Explicit)?.moduleInfo?.annotations
|
||||
}
|
||||
|
||||
private val sourceModule: JavaModule? = userModules.firstOrNull(JavaModule::isSourceModule)
|
||||
|
||||
private fun findJavaModule(file: VirtualFile): JavaModule? {
|
||||
@@ -77,4 +91,8 @@ class CliJavaModuleResolver(
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val MODULE_ANNOTATIONS_CACHE_SIZE = 10000
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,11 @@ object KotlinCompilerClient {
|
||||
fun CompileService.leaseImpl(): CompileServiceSession? {
|
||||
// the newJVMOptions could be checked here for additional parameters, if needed
|
||||
registerClient(clientAliveFlagFile.absolutePath)
|
||||
reportingTargets.report(DaemonReportCategory.DEBUG, "connected to the daemon")
|
||||
val javaExecutablePath = compilerId.javaExecutable?.absolutePath ?: "'user jvm'"
|
||||
reportingTargets.report(
|
||||
DaemonReportCategory.DEBUG,
|
||||
"connected to the daemon. Daemon is using following 'java' executable to run itself: $javaExecutablePath"
|
||||
)
|
||||
|
||||
if (!leaseSession) return CompileServiceSession(this, CompileService.NO_SESSION)
|
||||
|
||||
|
||||
@@ -2789,6 +2789,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/problems/secondaryConstructorCfg.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("symbolsAndDescriptors.kt")
|
||||
public void testSymbolsAndDescriptors() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/problems/symbolsAndDescriptors.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("transform.kt")
|
||||
public void testTransform() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/problems/transform.kt");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
public open class MethodWithFunctionTypes : R|kotlin/Any| {
|
||||
public open fun foo(f: R|(kotlin/String?) -> kotlin/String|): R|kotlin/String.() -> kotlin/String?|
|
||||
public open fun foo(f: R|(kotlin/String?) -> kotlin/String|): R|(kotlin/String.() -> kotlin/String?)?|
|
||||
|
||||
public constructor(): R|test/MethodWithFunctionTypes|
|
||||
|
||||
|
||||
@@ -1,8 +1,16 @@
|
||||
public final fun test1(): R|suspend () -> kotlin/Unit|
|
||||
|
||||
public final fun test1N(): R|(suspend () -> kotlin/Unit)?|
|
||||
|
||||
public final fun test2(): R|suspend kotlin/Int.() -> kotlin/Int|
|
||||
|
||||
public final fun test2N(): R|(suspend kotlin/Int.() -> kotlin/Int)?|
|
||||
|
||||
public final fun test3(): R|kotlin/collections/List<kotlin/coroutines/SuspendFunction0<kotlin/Unit>>|
|
||||
|
||||
public final fun test3N(): R|kotlin/collections/List<kotlin/coroutines/SuspendFunction0<kotlin/Unit>?>|
|
||||
|
||||
public final fun test4(): R|suspend () -> kotlin/coroutines/SuspendFunction0<kotlin/Unit>|
|
||||
|
||||
public final fun test4N(): R|(suspend () -> kotlin/coroutines/SuspendFunction0<kotlin/Unit>?)?|
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ FILE: A.kt
|
||||
}
|
||||
FILE: main.kt
|
||||
public final fun test_1(): R|kotlin/Unit| {
|
||||
lval a: R|ERROR CLASS: Unresolved name: A| = <Unresolved name: A>#()
|
||||
lval a: <ERROR TYPE REF: Unresolved name: A> = <Unresolved name: A>#()
|
||||
lval b: R|foo/A| = R|foo/A.A|()
|
||||
lval c: R|foo/A| = <Unresolved name: A>#()
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
FILE: safeCallOnTypeAlias.kt
|
||||
public final typealias MyTypeAlias = R|() -> kotlin/String?|
|
||||
public final typealias MyTypeAlias = R|(() -> kotlin/String?)?|
|
||||
public final fun foo(x: R|MyTypeAlias|): R|kotlin/Unit| {
|
||||
R|<local>/x|?.{ $subj$.R|kotlin/let|<R|() -> kotlin/String?|, R|kotlin/String?|>(<L> = let@fun <anonymous>(y: R|() -> kotlin/String?|): R|kotlin/String?| <inline=Inline, kind=EXACTLY_ONCE> {
|
||||
^ R|<local>/y|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/String?|>|()?.{ $subj$.R|kotlin/let|<R|kotlin/String|, R|kotlin/String|>(<L> = let@fun <anonymous>(result: R|kotlin/String|): R|kotlin/String| <inline=Inline, kind=EXACTLY_ONCE> {
|
||||
|
||||
@@ -18,7 +18,7 @@ FILE: cast.kt
|
||||
}
|
||||
|
||||
public get(): R|(kotlin/String) -> kotlin/Boolean|
|
||||
public final val hError: R|(ERROR CLASS: No type for parameter) -> kotlin/Boolean| = fun <anonymous>(_: R|ERROR CLASS: No type for parameter|): R|kotlin/Boolean| <inline=Unknown> {
|
||||
public final val hError: R|(ERROR CLASS: No type for parameter) -> kotlin/Boolean| = fun <anonymous>(_: <ERROR TYPE REF: No type for parameter>): R|kotlin/Boolean| <inline=Unknown> {
|
||||
^ Boolean(true)
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,6 @@ interface B
|
||||
|
||||
fun test_2(x: Any?) {
|
||||
if (x is A && x is B) {
|
||||
x is A
|
||||
<!USELESS_IS_CHECK!>x is A<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ FILE: kt41982.kt
|
||||
}
|
||||
|
||||
}
|
||||
public final fun <Type : R|Base|, Base : R|DelegateProvider<Base>|> R|Type|.long(initializer: R|() -> kotlin/Long?| = Null(null)): R|Delegate<Type, kotlin/Long>| {
|
||||
public final fun <Type : R|Base|, Base : R|DelegateProvider<Base>|> R|Type|.long(initializer: R|(() -> kotlin/Long?)?| = Null(null)): R|Delegate<Type, kotlin/Long>| {
|
||||
^long Null(null)!!
|
||||
}
|
||||
public final class Test : R|DelegateProvider<kotlin/Any>| {
|
||||
|
||||
@@ -25,7 +25,7 @@ FILE: instanceAccessBeforeSuperCall.kt
|
||||
}
|
||||
|
||||
public constructor(x: R|kotlin/Int|): R|C| {
|
||||
this<R|C|>(fun <anonymous>(): R|ERROR CLASS: Cannot access ''<this>'' before superclass constructor has been called| <inline=Unknown> {
|
||||
this<R|C|>(fun <anonymous>(): <ERROR TYPE REF: Cannot access ''<this>'' before superclass constructor has been called> <inline=Unknown> {
|
||||
lval a: R|kotlin/Int| = Int(10)
|
||||
^ this@R|/C|
|
||||
}
|
||||
@@ -63,8 +63,8 @@ FILE: instanceAccessBeforeSuperCall.kt
|
||||
}
|
||||
public final fun test(f: R|F|): R|kotlin/Unit| {
|
||||
}
|
||||
public final val a: R|ERROR CLASS: 'this' is not defined in this context| = this#
|
||||
public get(): R|ERROR CLASS: 'this' is not defined in this context|
|
||||
public final val a: <ERROR TYPE REF: 'this' is not defined in this context> = this#
|
||||
public get(): <ERROR TYPE REF: 'this' is not defined in this context>
|
||||
public final class F : R|kotlin/Any| {
|
||||
public constructor(a: R|kotlin/Int|, b: R|kotlin/Int|, closure: R|() -> kotlin/Unit|, instance: R|F?|): R|F| {
|
||||
super<R|kotlin/Any|>()
|
||||
|
||||
@@ -13,7 +13,7 @@ FILE: superIsNotAnExpression.kt
|
||||
public final fun act(): R|kotlin/Unit| {
|
||||
<Super cannot be a callee>#()
|
||||
<Unresolved name: invoke>#()
|
||||
<Super cannot be a callee>#(<L> = <Super cannot be a callee>@fun <anonymous>(): R|ERROR CLASS: Unresolved name: println| <inline=Unknown> {
|
||||
<Super cannot be a callee>#(<L> = <Super cannot be a callee>@fun <anonymous>(): <ERROR TYPE REF: Unresolved name: println> <inline=Unknown> {
|
||||
^ <Unresolved name: println>#(ERROR_EXPR(Incorrect character: 'weird'))
|
||||
}
|
||||
)
|
||||
|
||||
@@ -22,10 +22,10 @@ FILE: typeArgumentsNotAllowed.kt
|
||||
}
|
||||
|
||||
}
|
||||
public final val a: R|ERROR CLASS: Unresolved name: MyClass| = Q|rest|.<Unresolved name: MyClass>#
|
||||
public get(): R|ERROR CLASS: Unresolved name: MyClass|
|
||||
public final val b: R|ERROR CLASS: Unresolved name: MyClass| = Q|rest/Best|.<Unresolved name: MyClass>#
|
||||
public get(): R|ERROR CLASS: Unresolved name: MyClass|
|
||||
public final val a: <ERROR TYPE REF: Unresolved name: MyClass> = Q|rest|.<Unresolved name: MyClass>#
|
||||
public get(): <ERROR TYPE REF: Unresolved name: MyClass>
|
||||
public final val b: <ERROR TYPE REF: Unresolved name: MyClass> = Q|rest/Best|.<Unresolved name: MyClass>#
|
||||
public get(): <ERROR TYPE REF: Unresolved name: MyClass>
|
||||
public final class B<E> : R|kotlin/Any| {
|
||||
public constructor<E>(): R|rest/B<E>| {
|
||||
super<R|kotlin/Any|>()
|
||||
|
||||
@@ -22,7 +22,7 @@ FILE: upperBoundViolated.kt
|
||||
lval b1: R|B<kotlin/Int>| = R|/B.B|<R|kotlin/Int|>()
|
||||
lval b2: R|B<C>| = R|/B.B|<R|C|>()
|
||||
lval b3: R|B<kotlin/Any?>| = R|/B.B|<R|kotlin/Any?|>()
|
||||
lval b4: R|ERROR CLASS: Unresolved name: NumberPhile| = R|/B.B|<<ERROR TYPE REF: Symbol not found for UnexistingType>>().<Unresolved name: NL>#(ERROR_EXPR(No right operand)).<Unresolved name: Int>#(<Call has no callee>#()).<Unresolved name: NumberPhile>#(ERROR_EXPR(No right operand))
|
||||
lval b4: <ERROR TYPE REF: Unresolved name: NumberPhile> = R|/B.B|<<ERROR TYPE REF: Symbol not found for UnexistingType>>().<Unresolved name: NL>#(ERROR_EXPR(No right operand)).<Unresolved name: Int>#(<Call has no callee>#()).<Unresolved name: NumberPhile>#(ERROR_EXPR(No right operand))
|
||||
lval b5: R|B<B<ERROR CLASS: Symbol not found for UnexistingType>>| = R|/B.B|<R|B<ERROR CLASS: Symbol not found for UnexistingType>|>()
|
||||
R|/fest|<R|kotlin/Boolean|>()
|
||||
R|/fest|<R|C|>()
|
||||
@@ -58,8 +58,8 @@ FILE: upperBoundViolated.kt
|
||||
|
||||
}
|
||||
public final typealias NL<K> = R|NumColl<kotlin/collections/List<K>>|
|
||||
public final val test7: R|ERROR CLASS: Unresolved name: NumberPhile| = R|/NumColl.NumColl|<R|kotlin/Int|>().<Unresolved name: NumberPhile>#(ERROR_EXPR(No right operand))
|
||||
public get(): R|ERROR CLASS: Unresolved name: NumberPhile|
|
||||
public final val test7: <ERROR TYPE REF: Unresolved name: NumberPhile> = R|/NumColl.NumColl|<R|kotlin/Int|>().<Unresolved name: NumberPhile>#(ERROR_EXPR(No right operand))
|
||||
public get(): <ERROR TYPE REF: Unresolved name: NumberPhile>
|
||||
public final val test8: R|NumColl<kotlin/collections/List<kotlin/String>>| = R|/NumColl.NumColl|<R|kotlin/String|>()
|
||||
public get(): R|NumColl<kotlin/collections/List<kotlin/String>>|
|
||||
public final class NumberPhile<T : R|kotlin/Number|> : R|kotlin/Any| {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FILE: main.kt
|
||||
public final fun test_1(e: R|JavaEnum|): R|kotlin/Unit| {
|
||||
lval a: R|ERROR CLASS: Unresolved name: plus| = when (R|<local>/e|) {
|
||||
lval a: <ERROR TYPE REF: Unresolved name: plus> = when (R|<local>/e|) {
|
||||
==($subj$, Q|JavaEnum|.R|/JavaEnum.A|) -> {
|
||||
Int(1)
|
||||
}
|
||||
@@ -9,7 +9,7 @@ FILE: main.kt
|
||||
}
|
||||
}
|
||||
.<Unresolved name: plus>#(Int(0))
|
||||
lval b: R|ERROR CLASS: Unresolved name: plus| = when (R|<local>/e|) {
|
||||
lval b: <ERROR TYPE REF: Unresolved name: plus> = when (R|<local>/e|) {
|
||||
==($subj$, Q|JavaEnum|.R|/JavaEnum.A|) -> {
|
||||
Int(1)
|
||||
}
|
||||
@@ -44,7 +44,7 @@ FILE: main.kt
|
||||
.R|kotlin/Int.plus|(Int(0))
|
||||
}
|
||||
public final fun test_2(e: R|JavaEnum?|): R|kotlin/Unit| {
|
||||
lval a: R|ERROR CLASS: Unresolved name: plus| = when (R|<local>/e|) {
|
||||
lval a: <ERROR TYPE REF: Unresolved name: plus> = when (R|<local>/e|) {
|
||||
==($subj$, Q|JavaEnum|.R|/JavaEnum.A|) -> {
|
||||
Int(1)
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ FILE: exhaustiveness_sealedSubClass.kt
|
||||
.R|kotlin/Int.plus|(Int(0))
|
||||
}
|
||||
public final fun test_2(e: R|A|): R|kotlin/Unit| {
|
||||
lval a: R|ERROR CLASS: Unresolved name: plus| = when (R|<local>/e|) {
|
||||
lval a: <ERROR TYPE REF: Unresolved name: plus> = when (R|<local>/e|) {
|
||||
($subj$ is R|D|) -> {
|
||||
Int(1)
|
||||
}
|
||||
@@ -86,7 +86,7 @@ FILE: exhaustiveness_sealedSubClass.kt
|
||||
}
|
||||
}
|
||||
.<Unresolved name: plus>#(Int(0))
|
||||
lval b: R|ERROR CLASS: Unresolved name: plus| = when (R|<local>/e|) {
|
||||
lval b: <ERROR TYPE REF: Unresolved name: plus> = when (R|<local>/e|) {
|
||||
($subj$ is R|B|) -> {
|
||||
Int(1)
|
||||
}
|
||||
@@ -98,7 +98,7 @@ FILE: exhaustiveness_sealedSubClass.kt
|
||||
}
|
||||
}
|
||||
.<Unresolved name: plus>#(Int(0))
|
||||
lval c: R|ERROR CLASS: Unresolved name: plus| = when (R|<local>/e|) {
|
||||
lval c: <ERROR TYPE REF: Unresolved name: plus> = when (R|<local>/e|) {
|
||||
($subj$ is R|B|) -> {
|
||||
Int(1)
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ fun test_1(e: A) {
|
||||
|
||||
val d = when (e) {
|
||||
is E -> 1
|
||||
is A -> 2
|
||||
<!USELESS_IS_CHECK!>is A<!> -> 2
|
||||
}.plus(0)
|
||||
}
|
||||
|
||||
|
||||
@@ -29,8 +29,8 @@ FILE: CallBasedInExpressionGenerator.kt
|
||||
public final val codegen: R|org/jetbrains/kotlin/codegen/range/inExpression/ExpressionCodegen| = R|<local>/codegen|
|
||||
public get(): R|org/jetbrains/kotlin/codegen/range/inExpression/ExpressionCodegen|
|
||||
|
||||
private final val resolvedCall: R|ERROR CLASS: Unresolved name: getResolvedCallWithAssert| = R|<local>/operatorReference|.<Unresolved name: getResolvedCallWithAssert>#(this@R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator|.R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator.codegen|.<Unresolved name: bindingContext>#)
|
||||
private get(): R|ERROR CLASS: Unresolved name: getResolvedCallWithAssert|
|
||||
private final val resolvedCall: <ERROR TYPE REF: Unresolved name: getResolvedCallWithAssert> = R|<local>/operatorReference|.<Unresolved name: getResolvedCallWithAssert>#(this@R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator|.R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator.codegen|.<Unresolved name: bindingContext>#)
|
||||
private get(): <ERROR TYPE REF: Unresolved name: getResolvedCallWithAssert>
|
||||
|
||||
private final val isInverted: R|kotlin/Boolean| = ==(R|<local>/operatorReference|.<Unresolved name: getReferencedNameElementType>#(), <Unresolved name: KtTokens>#.<Unresolved name: NOT_IN>#)
|
||||
private get(): R|kotlin/Boolean|
|
||||
@@ -75,7 +75,7 @@ FILE: CallBasedInExpressionGenerator.kt
|
||||
}
|
||||
|
||||
private final fun invokeFunction(v: R|org/jetbrains/kotlin/codegen/range/inExpression/InstructionAdapter|): R|kotlin/Unit| {
|
||||
lval result: R|ERROR CLASS: Unresolved name: invokeFunction| = this@R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator|.R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator.codegen|.<Unresolved name: invokeFunction>#(this@R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator|.R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator.resolvedCall|.<Unresolved name: call>#, this@R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator|.R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator.resolvedCall|, <Unresolved name: none>#())
|
||||
lval result: <ERROR TYPE REF: Unresolved name: invokeFunction> = this@R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator|.R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator.codegen|.<Unresolved name: invokeFunction>#(this@R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator|.R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator.resolvedCall|.<Unresolved name: call>#, this@R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator|.R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator.resolvedCall|, <Unresolved name: none>#())
|
||||
R|<local>/result|.<Unresolved name: put>#(R|<local>/result|.<Unresolved name: type>#, R|<local>/result|.<Unresolved name: kotlinType>#, R|<local>/v|)
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ FILE: access.kt
|
||||
lval a: R|kotlin/Int| = Int(10)
|
||||
lval b: R|kotlin/Int| = R|<local>/a|
|
||||
lval d: R|kotlin/String| = String()
|
||||
lval c: R|ERROR CLASS: Unresolved name: c| = <Unresolved name: c>#
|
||||
lval c: <ERROR TYPE REF: Unresolved name: c> = <Unresolved name: c>#
|
||||
<Unresolved name: abc>#()
|
||||
local final fun bcd(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ FILE: Test.kt
|
||||
lval bbd: R|BB.D| = Q|BB.D|
|
||||
lval aac: R|AA.C| = Q|AA.C|
|
||||
Q|JavaClass|.R|/JavaClass.bar|()
|
||||
lval errC: R|ERROR CLASS: Unresolved name: C| = Q|BB|.<Unresolved name: C>#
|
||||
lval errBarViaBB: R|ERROR CLASS: Unresolved name: bar| = Q|BB|.<Unresolved name: bar>#()
|
||||
lval errBarViaAA: R|ERROR CLASS: Unresolved name: bar| = Q|AA|.<Unresolved name: bar>#()
|
||||
lval errC: <ERROR TYPE REF: Unresolved name: C> = Q|BB|.<Unresolved name: C>#
|
||||
lval errBarViaBB: <ERROR TYPE REF: Unresolved name: bar> = Q|BB|.<Unresolved name: bar>#()
|
||||
lval errBarViaAA: <ERROR TYPE REF: Unresolved name: bar> = Q|AA|.<Unresolved name: bar>#()
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ class Factory {
|
||||
}
|
||||
|
||||
companion object {
|
||||
val f = Function
|
||||
val f = <!NO_COMPANION_OBJECT!>Function<!>
|
||||
val x = Function.Default
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,5 +47,5 @@ FILE: companion.kt
|
||||
Q|B|.R|/B.Companion.baz|()
|
||||
lval x: R|kotlin/String| = Q|A|.R|/A.Companion.D|
|
||||
lval y: R|kotlin/String| = Q|B|.R|/B.Companion.C|
|
||||
lval z: R|ERROR CLASS: Unresolved name: D| = Q|B|.<Unresolved name: D>#
|
||||
lval z: <ERROR TYPE REF: Unresolved name: D> = Q|B|.<Unresolved name: D>#
|
||||
}
|
||||
|
||||
@@ -18,10 +18,10 @@ FILE: errCallable.kt
|
||||
}
|
||||
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
lval x: R|ERROR CLASS: Unresolved reference: Nested| = ::<Unresolved reference: Nested>#
|
||||
lval x: <ERROR TYPE REF: Unresolved reference: Nested> = ::<Unresolved reference: Nested>#
|
||||
}
|
||||
|
||||
}
|
||||
public final fun R|Your|.foo(): R|kotlin/Unit| {
|
||||
lval x: R|ERROR CLASS: Unresolved reference: Nested| = ::<Unresolved reference: Nested>#
|
||||
lval x: <ERROR TYPE REF: Unresolved reference: Nested> = ::<Unresolved reference: Nested>#
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ class Outer {
|
||||
inner class Inner
|
||||
}
|
||||
|
||||
val x = Outer.Inner
|
||||
val x = Outer.<!NO_COMPANION_OBJECT!>Inner<!>
|
||||
val klass = Outer.Inner::class
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
FILE: propertyWithExtensionType.kt
|
||||
public final class A : R|kotlin/Any| {
|
||||
public constructor(x: R|kotlin/String.() -> kotlin/Unit|, y: R|kotlin/String.() -> kotlin/Int|): R|A| {
|
||||
public constructor(x: R|(kotlin/String.() -> kotlin/Unit)?|, y: R|kotlin/String.() -> kotlin/Int|): R|A| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final val x: R|kotlin/String.() -> kotlin/Unit| = R|<local>/x|
|
||||
public get(): R|kotlin/String.() -> kotlin/Unit|
|
||||
public final val x: R|(kotlin/String.() -> kotlin/Unit)?| = R|<local>/x|
|
||||
public get(): R|(kotlin/String.() -> kotlin/Unit)?|
|
||||
|
||||
public final val y: R|kotlin/String.() -> kotlin/Int| = R|<local>/y|
|
||||
public get(): R|kotlin/String.() -> kotlin/Int|
|
||||
@@ -14,7 +14,7 @@ FILE: propertyWithExtensionType.kt
|
||||
public final fun test(a: R|A|): R|kotlin/Unit| {
|
||||
when () {
|
||||
!=(R|<local>/a|.R|/A.x|, Null(null)) -> {
|
||||
lval b: R|kotlin/String.() -> kotlin/Unit| = R|<local>/a|.R|/A.x|
|
||||
lval b: R|(kotlin/String.() -> kotlin/Unit)?| = R|<local>/a|.R|/A.x|
|
||||
R|<local>/b|.R|SubstitutionOverride<kotlin/Function1.invoke: R|kotlin/Unit|>|(String())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,5 +40,5 @@ FILE: localObjects.kt
|
||||
|
||||
Q|B|.R|/B.foo|()
|
||||
}
|
||||
public final val bb: R|ERROR CLASS: Unresolved name: foo| = <Unresolved name: B>#.<Unresolved name: foo>#()
|
||||
public get(): R|ERROR CLASS: Unresolved name: foo|
|
||||
public final val bb: <ERROR TYPE REF: Unresolved name: foo> = <Unresolved name: B>#.<Unresolved name: foo>#()
|
||||
public get(): <ERROR TYPE REF: Unresolved name: foo>
|
||||
|
||||
@@ -25,7 +25,7 @@ FILE: nestedObjects.kt
|
||||
}
|
||||
|
||||
}
|
||||
public final val err: R|ERROR CLASS: Unresolved name: B| = Q|B|.<Unresolved name: A>#.<Unresolved name: B>#
|
||||
public get(): R|ERROR CLASS: Unresolved name: B|
|
||||
public final val err: <ERROR TYPE REF: Unresolved name: B> = Q|B|.<Unresolved name: A>#.<Unresolved name: B>#
|
||||
public get(): <ERROR TYPE REF: Unresolved name: B>
|
||||
public final val correct: R|A.B.A| = Q|A.B.A|
|
||||
public get(): R|A.B.A|
|
||||
|
||||
@@ -33,7 +33,7 @@ FILE: privateObjectLiteral.kt
|
||||
|
||||
internal get(): R|kotlin/Any|
|
||||
|
||||
public final val w: R|ERROR CLASS: Unresolved name: foo| = this@R|/C|.R|/C.z|.<Unresolved name: foo>#()
|
||||
public get(): R|ERROR CLASS: Unresolved name: foo|
|
||||
public final val w: <ERROR TYPE REF: Unresolved name: foo> = this@R|/C|.R|/C.z|.<Unresolved name: foo>#()
|
||||
public get(): <ERROR TYPE REF: Unresolved name: foo>
|
||||
|
||||
}
|
||||
|
||||
@@ -23,7 +23,8 @@ object D {
|
||||
val D.E get() = ""
|
||||
|
||||
val def = D.E.F // object
|
||||
val de = D.E // extension
|
||||
// See KT-46409
|
||||
val de = D.<!NO_COMPANION_OBJECT!>E<!> // Should be: extension & no error, in fact: qualifier
|
||||
|
||||
enum class G {
|
||||
H;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
fun foo() = if (true) 1 else 0
|
||||
|
||||
fun bar(arg: Any?) = when (arg) {
|
||||
is Int -> arg as Int
|
||||
is Int -> arg <!USELESS_CAST!>as Int<!>
|
||||
else -> 42
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ interface I {
|
||||
}
|
||||
|
||||
class A {
|
||||
fun too(): <!NOT_AN_ANNOTATION_CLASS, NOT_AN_ANNOTATION_CLASS!>@Annotation<!> Unit {}
|
||||
fun too(): <!NOT_AN_ANNOTATION_CLASS!>@Annotation<!> Unit {}
|
||||
|
||||
fun foo(): <!REDUNDANT_RETURN_UNIT_TYPE!>Unit<!>
|
||||
{
|
||||
|
||||
@@ -8,8 +8,8 @@ FILE: kt41989.kt
|
||||
|
||||
}
|
||||
public abstract interface C : R|B| {
|
||||
public open val lineCellStyle: R|A.() -> kotlin/Unit|
|
||||
public get(): R|A.() -> kotlin/Unit| {
|
||||
public open val lineCellStyle: R|(A.() -> kotlin/Unit)?|
|
||||
public get(): R|(A.() -> kotlin/Unit)?| {
|
||||
^ when () {
|
||||
R|/cond|() -> {
|
||||
fun R|A|.<anonymous>(): R|kotlin/Unit| <inline=Unknown> {
|
||||
|
||||
@@ -41,7 +41,7 @@ FILE: inner.kt
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
lval o: R|Owner| = R|/Owner.Owner|()
|
||||
R|<local>/o|.R|/Owner.foo|()
|
||||
lval err: R|ERROR CLASS: Unresolved name: Inner| = Q|Owner|.<Unresolved name: Inner>#()
|
||||
lval err: <ERROR TYPE REF: Unresolved name: Inner> = Q|Owner|.<Unresolved name: Inner>#()
|
||||
R|<local>/err|.<Unresolved name: baz>#()
|
||||
lval i: R|Owner.Inner| = R|<local>/o|.R|/Owner.Inner.Inner|()
|
||||
R|<local>/i|.R|/Owner.Inner.gau|()
|
||||
|
||||
@@ -21,14 +21,14 @@ FILE: lambdaArgInScopeFunction.kt
|
||||
this@R|special/anonymous|.R|/_|<R|KotlinClass?|>()
|
||||
}
|
||||
)
|
||||
lval lambda: R|() -> KotlinClass| = R|<local>/kotlinClass|?.{ $subj$.R|kotlin/let|<R|KotlinClass|, R|() -> KotlinClass|>(<L> = let@fun <anonymous>(it: R|KotlinClass|): R|() -> KotlinClass| <inline=Inline, kind=EXACTLY_ONCE> {
|
||||
lval lambda: R|(() -> KotlinClass)?| = R|<local>/kotlinClass|?.{ $subj$.R|kotlin/let|<R|KotlinClass|, R|() -> KotlinClass|>(<L> = let@fun <anonymous>(it: R|KotlinClass|): R|() -> KotlinClass| <inline=Inline, kind=EXACTLY_ONCE> {
|
||||
^ let@fun <anonymous>(): R|KotlinClass| <inline=Unknown> {
|
||||
^ R|<local>/it|
|
||||
}
|
||||
|
||||
}
|
||||
) }
|
||||
R|<local>/lambda|.R|/checkType|<R|() -> KotlinClass|>(<L> = checkType@fun R|CheckTypeInv<kotlin/Function0<KotlinClass>?>|.<anonymous>(): R|kotlin/Unit| <inline=NoInline> {
|
||||
R|<local>/lambda|.R|/checkType|<R|(() -> KotlinClass)?|>(<L> = checkType@fun R|CheckTypeInv<kotlin/Function0<KotlinClass>?>|.<anonymous>(): R|kotlin/Unit| <inline=NoInline> {
|
||||
this@R|special/anonymous|.<Inapplicable(INAPPLICABLE_WRONG_RECEIVER): /_>#<R|(kotlin/Unit) -> KotlinClass?|>()
|
||||
}
|
||||
)
|
||||
|
||||
@@ -32,7 +32,7 @@ fun case1(javaClass: JavaClass?) {
|
||||
}
|
||||
|
||||
class Case1(val javaClass: JavaClass?) {
|
||||
val x = if (javaClass != null) { it -> it == javaClass } else BooCase2.FILTER
|
||||
val x = if (javaClass != null) { it -> <!EQUALITY_NOT_APPLICABLE_WARNING!>it == javaClass<!> } else BooCase2.FILTER
|
||||
}
|
||||
|
||||
class BooCase1() {
|
||||
|
||||
@@ -35,7 +35,7 @@ FILE: nestedClassContructor.kt
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
lval a: R|A| = R|/A.A|()
|
||||
lval ac: R|A.C| = Q|A|.R|/A.C.C|()
|
||||
lval c: R|ERROR CLASS: Unresolved name: C| = <Unresolved name: C>#()
|
||||
lval c: <ERROR TYPE REF: Unresolved name: C> = <Unresolved name: C>#()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ FILE: test.kt
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
lval descriptor: R|WrappedPropertyDescriptor| = R|/WrappedPropertyDescriptor.WrappedPropertyDescriptor|()
|
||||
lval res1: R|kotlin/String| = R|<local>/descriptor|.R|/WrappedPropertyDescriptor.setter|
|
||||
lval res2: R|ERROR CLASS: Unresolved name: getSetter| = R|<local>/descriptor|.<Unresolved name: getSetter>#()
|
||||
lval res2: <ERROR TYPE REF: Unresolved name: getSetter> = R|<local>/descriptor|.<Unresolved name: getSetter>#()
|
||||
lval res3: R|kotlin/Boolean| = R|<local>/descriptor|.R|/WrappedPropertyDescriptor.isDelegated|
|
||||
lval res4: R|ERROR CLASS: Unresolved name: isDelegated| = R|<local>/descriptor|.<Unresolved name: isDelegated>#()
|
||||
lval res4: <ERROR TYPE REF: Unresolved name: isDelegated> = R|<local>/descriptor|.<Unresolved name: isDelegated>#()
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
FILE: main.kt
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
lval some: R|foo/Some| = R|foo/Some.Some|()
|
||||
lval another: R|ERROR CLASS: Unresolved name: Another| = <Unresolved name: Another>#()
|
||||
lval another: <ERROR TYPE REF: Unresolved name: Another> = <Unresolved name: Another>#()
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// FILE: foo/Some.java
|
||||
|
||||
package foo;
|
||||
|
||||
46
compiler/fir/analysis-tests/testData/resolve/problems/symbolsAndDescriptors.fir.txt
vendored
Normal file
46
compiler/fir/analysis-tests/testData/resolve/problems/symbolsAndDescriptors.fir.txt
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
FILE: symbolsAndDescriptors.kt
|
||||
public final class IrClassSymbolImpl : R|IrBindableSymbolBase<kotlin/String>|, R|IrClassSymbol| {
|
||||
public constructor(descriptor: R|kotlin/String?| = Null(null)): R|IrClassSymbolImpl| {
|
||||
super<R|IrBindableSymbolBase<kotlin/String>|>(R|<local>/descriptor|)
|
||||
}
|
||||
|
||||
}
|
||||
public abstract interface IrClassSymbol : R|IrClassifierSymbol|, R|IrBindableSymbol<kotlin/String>| {
|
||||
}
|
||||
public abstract interface IrClassifierSymbol : R|IrSymbol|, R|TypeConstructorMarker| {
|
||||
public abstract override val descriptor: R|kotlin/CharSequence|
|
||||
public get(): R|kotlin/CharSequence|
|
||||
|
||||
}
|
||||
public abstract interface IrSymbol : R|kotlin/Any| {
|
||||
public abstract val descriptor: R|kotlin/Any|
|
||||
public get(): R|kotlin/Any|
|
||||
|
||||
}
|
||||
public abstract interface TypeConstructorMarker : R|kotlin/Any| {
|
||||
}
|
||||
public abstract interface IrBindableSymbol<out D : R|kotlin/Any|> : R|IrSymbol| {
|
||||
public abstract override val descriptor: R|D|
|
||||
public get(): R|D|
|
||||
|
||||
}
|
||||
public abstract class IrBindableSymbolBase<out D : R|kotlin/Any|> : R|IrBindableSymbol<D>|, R|IrSymbolBase<D>| {
|
||||
public constructor<out D : R|kotlin/Any|>(descriptor: R|D?|): R|IrBindableSymbolBase<D>| {
|
||||
super<R|IrSymbolBase<D>|>(R|<local>/descriptor|)
|
||||
}
|
||||
|
||||
}
|
||||
public abstract class IrSymbolBase<out D : R|kotlin/Any|> : R|IrSymbol| {
|
||||
public constructor<out D : R|kotlin/Any|>(_descriptor: R|D?|): R|IrSymbolBase<D>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
private final val _descriptor: R|D?| = R|<local>/_descriptor|
|
||||
private get(): R|D?|
|
||||
|
||||
public open override val descriptor: R|D|
|
||||
public get(): R|D| {
|
||||
^ this@R|/IrSymbolBase|.R|/IrSymbolBase._descriptor|!!
|
||||
}
|
||||
|
||||
}
|
||||
33
compiler/fir/analysis-tests/testData/resolve/problems/symbolsAndDescriptors.kt
vendored
Normal file
33
compiler/fir/analysis-tests/testData/resolve/problems/symbolsAndDescriptors.kt
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
class IrClassSymbolImpl(descriptor: String? = null) :
|
||||
IrBindableSymbolBase<String>(descriptor),
|
||||
IrClassSymbol
|
||||
|
||||
interface IrClassSymbol : IrClassifierSymbol, IrBindableSymbol<String>
|
||||
|
||||
interface IrClassifierSymbol : IrSymbol, TypeConstructorMarker {
|
||||
override val descriptor: CharSequence
|
||||
}
|
||||
|
||||
interface IrSymbol {
|
||||
val descriptor: Any
|
||||
}
|
||||
|
||||
interface TypeConstructorMarker
|
||||
|
||||
interface IrBindableSymbol<out D : Any> : IrSymbol {
|
||||
override val descriptor: D
|
||||
}
|
||||
|
||||
abstract class IrBindableSymbolBase<out D : Any>(descriptor: D?) :
|
||||
IrBindableSymbol<D>, IrSymbolBase<D>(descriptor)
|
||||
|
||||
abstract class IrSymbolBase<out D : Any>(
|
||||
private val _descriptor: D?
|
||||
) : IrSymbol {
|
||||
override val descriptor: D
|
||||
get() = _descriptor!!
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
FILE: main.kt
|
||||
public final fun test_1(x: R|A|): R|kotlin/Unit| {
|
||||
lval str1: R|ft<kotlin/String, kotlin/String?>| = R|<local>/x|.R|/A.vmParameters|
|
||||
lval str2: R|ERROR CLASS: Unresolved name: vMParameters| = R|<local>/x|.<Unresolved name: vMParameters>#
|
||||
lval str2: <ERROR TYPE REF: Unresolved name: vMParameters> = R|<local>/x|.<Unresolved name: vMParameters>#
|
||||
}
|
||||
public final fun test_2(x: R|B|): R|kotlin/Unit| {
|
||||
lval int: R|ft<kotlin/Int, kotlin/Int?>| = R|<local>/x|.R|/B.vmParameters|
|
||||
lval error: R|ERROR CLASS: Unresolved name: vMParameters| = R|<local>/x|.<Unresolved name: vMParameters>#
|
||||
lval error: <ERROR TYPE REF: Unresolved name: vMParameters> = R|<local>/x|.<Unresolved name: vMParameters>#
|
||||
}
|
||||
public final fun test_3(x: R|C|): R|kotlin/Unit| {
|
||||
lval error: R|ERROR CLASS: Ambiguity: vmParameters, [/C.vmParameters, /C.vmParameters]| = R|<local>/x|.<Ambiguity: vmParameters, [/C.vmParameters, /C.vmParameters]>#
|
||||
lval int: R|ERROR CLASS: Unresolved name: vMParameters| = R|<local>/x|.<Unresolved name: vMParameters>#
|
||||
lval error: <ERROR TYPE REF: Ambiguity: vmParameters, [/C.vmParameters, /C.vmParameters]> = R|<local>/x|.<Ambiguity: vmParameters, [/C.vmParameters, /C.vmParameters]>#
|
||||
lval int: <ERROR TYPE REF: Unresolved name: vMParameters> = R|<local>/x|.<Unresolved name: vMParameters>#
|
||||
}
|
||||
public final class Foo : R|kotlin/Any| {
|
||||
public constructor(): R|Foo| {
|
||||
|
||||
@@ -7,7 +7,7 @@ FILE: leakedImplicitType.kt
|
||||
public final fun bar(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
public final fun f(): R|ERROR CLASS: Unresolved reference: bar| {
|
||||
public final fun f(): <ERROR TYPE REF: Unresolved reference: bar> {
|
||||
^f <Unresolved name: Unresolved>#()::<Unresolved reference: bar>#
|
||||
}
|
||||
|
||||
|
||||
@@ -40,8 +40,8 @@ FILE: referenceToExtension.kt
|
||||
}
|
||||
|
||||
public final fun test_2(): R|kotlin/Unit| {
|
||||
lval extensionValRef: R|ERROR CLASS: Unresolved reference: extensionVal| = Q|GenericTest.B|::<Unresolved reference: extensionVal>#
|
||||
lval extensionFunRef: R|ERROR CLASS: Unresolved reference: extensionFun| = Q|GenericTest.B|::<Unresolved reference: extensionFun>#
|
||||
lval extensionValRef: <ERROR TYPE REF: Unresolved reference: extensionVal> = Q|GenericTest.B|::<Unresolved reference: extensionVal>#
|
||||
lval extensionFunRef: <ERROR TYPE REF: Unresolved reference: extensionFun> = Q|GenericTest.B|::<Unresolved reference: extensionFun>#
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
FILE: smartcastOnLambda.kt
|
||||
public final fun test(func: R|() -> kotlin/Unit|): R|kotlin/Unit| {
|
||||
public final fun test(func: R|(() -> kotlin/Unit)?|): R|kotlin/Unit| {
|
||||
when () {
|
||||
!=(R|<local>/func|, Null(null)) -> {
|
||||
R|<local>/func|.R|SubstitutionOverride<kotlin/Function0.invoke: R|kotlin/Unit|>|()
|
||||
|
||||
@@ -3,7 +3,7 @@ class Some
|
||||
fun foo(): () -> Boolean {
|
||||
val s = Some()
|
||||
if (true) {
|
||||
return { if (s is Some) true else false }
|
||||
return { if (<!USELESS_IS_CHECK!>s is Some<!>) true else false }
|
||||
} else {
|
||||
return { true }
|
||||
}
|
||||
|
||||
@@ -45,12 +45,12 @@ fun case3() {
|
||||
|
||||
val flag = "" //A
|
||||
val l1 = <!NO_ELSE_IN_WHEN!>when<!> (flag<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>) {// should be NO_ELSE_IN_WHEN
|
||||
A.A1 -> B() //should be INCOMPATIBLE_TYPES
|
||||
A.A2 -> B() //should be INCOMPATIBLE_TYPES
|
||||
<!INCOMPATIBLE_TYPES!>A.A1<!> -> B() //should be INCOMPATIBLE_TYPES
|
||||
<!INCOMPATIBLE_TYPES!>A.A2<!> -> B() //should be INCOMPATIBLE_TYPES
|
||||
}
|
||||
|
||||
val l2 = <!NO_ELSE_IN_WHEN!>when<!> (flag) {// should be NO_ELSE_IN_WHEN
|
||||
A.A1 -> B() //should be INCOMPATIBLE_TYPES
|
||||
A.A2 -> B() //should be INCOMPATIBLE_TYPES
|
||||
<!INCOMPATIBLE_TYPES!>A.A1<!> -> B() //should be INCOMPATIBLE_TYPES
|
||||
<!INCOMPATIBLE_TYPES!>A.A2<!> -> B() //should be INCOMPATIBLE_TYPES
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ FILE: beyoundCalls.kt
|
||||
}
|
||||
public final fun foo(): R|kotlin/Unit| {
|
||||
lval x: R|(kotlin/String) -> kotlin/Int| = ::R|/bar|
|
||||
lval y: R|ERROR CLASS: Ambiguity: bar, [/bar, /bar]| = ::<Ambiguity: bar, [/bar, /bar]>#
|
||||
lval y: <ERROR TYPE REF: Ambiguity: bar, [/bar, /bar]> = ::<Ambiguity: bar, [/bar, /bar]>#
|
||||
lval z: R|kotlin/reflect/KFunction1<kotlin/String, kotlin/Int>| = ::R|/baz|
|
||||
lval w: R|(kotlin/String) -> kotlin/Int| = ::R|/foobaz<kotlin/String, kotlin/Int>|
|
||||
::R|/baz|
|
||||
|
||||
@@ -9,7 +9,7 @@ FILE: moreSpecificAmbiguousExtensions.kt
|
||||
}
|
||||
public final fun test(): R|kotlin/Unit| {
|
||||
lval extFun1: R|@ExtensionFunctionType kotlin/reflect/KFunction2<IA, IB, kotlin/Unit>| = Q|IA|::R|/extFun|
|
||||
lval extFun2: R|ERROR CLASS: Ambiguity: extFun, [/extFun, /extFun]| = Q|IB|::<Ambiguity: extFun, [/extFun, /extFun]>#
|
||||
lval extFun2: <ERROR TYPE REF: Ambiguity: extFun, [/extFun, /extFun]> = Q|IB|::<Ambiguity: extFun, [/extFun, /extFun]>#
|
||||
}
|
||||
public final fun testWithExpectedType(): R|kotlin/Unit| {
|
||||
lval extFun_AB_A: R|IA.(IB) -> kotlin/Unit| = Q|IA|::R|/extFun|
|
||||
|
||||
@@ -172,9 +172,9 @@ FILE: forLoopChecker.kt
|
||||
}
|
||||
public final fun test(notRange1: R|NotRange1|, notRange2: R|NotRange2|, notRange3: R|NotRange3|, notRange4: R|NotRange4|, notRange5: R|NotRange5|, notRange6: R|NotRange6|, notRange7: R|NotRange7|, notRange8: R|NotRange8|, notRange9: R|NotRange9|, range0: R|Range0|, range1: R|Range1|): R|kotlin/Unit| {
|
||||
{
|
||||
lval <iterator>: R|ERROR CLASS: Unresolved name: iterator| = R|<local>/notRange1|.<Unresolved name: iterator>#()
|
||||
lval <iterator>: <ERROR TYPE REF: Unresolved name: iterator> = R|<local>/notRange1|.<Unresolved name: iterator>#()
|
||||
while(R|<local>/<iterator>|.<Unresolved name: hasNext>#()) {
|
||||
lval i: R|ERROR CLASS: Unresolved name: next| = R|<local>/<iterator>|.<Unresolved name: next>#()
|
||||
lval i: <ERROR TYPE REF: Unresolved name: next> = R|<local>/<iterator>|.<Unresolved name: next>#()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -182,7 +182,7 @@ FILE: forLoopChecker.kt
|
||||
{
|
||||
lval <iterator>: R|kotlin/Unit| = R|<local>/notRange2|.R|/NotRange2.iterator|()
|
||||
while(R|<local>/<iterator>|.<Unresolved name: hasNext>#()) {
|
||||
lval i: R|ERROR CLASS: Unresolved name: next| = R|<local>/<iterator>|.<Unresolved name: next>#()
|
||||
lval i: <ERROR TYPE REF: Unresolved name: next> = R|<local>/<iterator>|.<Unresolved name: next>#()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -190,7 +190,7 @@ FILE: forLoopChecker.kt
|
||||
{
|
||||
lval <iterator>: R|ImproperIterator1| = R|<local>/notRange3|.R|/NotRange3.iterator|()
|
||||
while(R|<local>/<iterator>|.R|/ImproperIterator1.hasNext|()) {
|
||||
lval i: R|ERROR CLASS: Unresolved name: next| = R|<local>/<iterator>|.<Unresolved name: next>#()
|
||||
lval i: <ERROR TYPE REF: Unresolved name: next> = R|<local>/<iterator>|.<Unresolved name: next>#()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// FILE: K1.kt
|
||||
class KSub : J1()
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ FILE: test.kt
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
private final val klass: R|java/lang/Class<MyTest>| = <getClass>(this@R|/MyTest|).R|kotlin/jvm/java|<R|MyTest|>
|
||||
private get(): R|java/lang/Class<MyTest>|
|
||||
private final val klass: R|java/lang/Class<out MyTest>| = <getClass>(this@R|/MyTest|).R|kotlin/jvm/java|<R|MyTest|>
|
||||
private get(): R|java/lang/Class<out MyTest>|
|
||||
|
||||
private final val logger: R|ft<Logger, Logger?>| = Q|Logger|.R|/Logger.getInstance|(this@R|/MyTest|.R|/MyTest.klass|)
|
||||
private get(): R|ft<Logger, Logger?>|
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDE_IGNORE
|
||||
// FILE: K1.kt
|
||||
class K2: J1() {
|
||||
class Q : <!UNRESOLVED_REFERENCE!>Nested<!>()
|
||||
|
||||
30
compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/capturedTypeInEquality.fir.txt
vendored
Normal file
30
compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/capturedTypeInEquality.fir.txt
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
FILE: capturedTypeInEquality.kt
|
||||
public abstract interface FirTargetElement : R|kotlin/Any| {
|
||||
}
|
||||
public abstract interface FirFunction<F : R|FirFunction<F>|> : R|FirTargetElement| {
|
||||
}
|
||||
public abstract interface FirPropertyAccessor : R|FirFunction<FirPropertyAccessor>| {
|
||||
}
|
||||
public abstract interface FirProperty : R|kotlin/Any| {
|
||||
public abstract val getter: R|FirPropertyAccessor|
|
||||
public get(): R|FirPropertyAccessor|
|
||||
|
||||
}
|
||||
public abstract interface FirTarget<E : R|FirTargetElement|> : R|kotlin/Any| {
|
||||
public abstract val labeledElement: R|E|
|
||||
public get(): R|E|
|
||||
|
||||
}
|
||||
public final fun foo(target: R|FirTarget<FirFunction<*>>|, property: R|FirProperty|): R|kotlin/Unit| {
|
||||
lval functionTarget: R|FirFunction<*>| = R|<local>/target|.R|SubstitutionOverride</FirTarget.labeledElement: R|FirFunction<*>|>|
|
||||
lval x: R|kotlin/Int?| = (R|<local>/functionTarget| as? R|FirFunction<CapturedType(*)>|)?.{ $subj$.R|kotlin/let|<R|FirFunction<*>|, R|kotlin/Int|>(<L> = let@fun <anonymous>(it: R|FirFunction<*>|): R|kotlin/Int| <inline=Inline, kind=EXACTLY_ONCE> {
|
||||
when () {
|
||||
===(R|<local>/property|.R|/FirProperty.getter|, R|<local>/functionTarget|) -> {
|
||||
^@let Int(1)
|
||||
}
|
||||
}
|
||||
|
||||
^ Int(0)
|
||||
}
|
||||
) }
|
||||
}
|
||||
23
compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/capturedTypeInEquality.kt
vendored
Normal file
23
compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/capturedTypeInEquality.kt
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
interface FirTargetElement
|
||||
|
||||
interface FirFunction<F : FirFunction<F>> : FirTargetElement
|
||||
|
||||
interface FirPropertyAccessor : FirFunction<FirPropertyAccessor>
|
||||
|
||||
interface FirProperty {
|
||||
val getter: FirPropertyAccessor
|
||||
}
|
||||
|
||||
interface FirTarget<E : FirTargetElement> {
|
||||
val labeledElement: E
|
||||
}
|
||||
|
||||
fun foo(target: FirTarget<FirFunction<*>>, property: FirProperty) {
|
||||
val functionTarget = target.labeledElement
|
||||
val x = (functionTarget as? FirFunction)?.let {
|
||||
if (<!EQUALITY_NOT_APPLICABLE_WARNING!>property.getter === functionTarget<!>) {
|
||||
return@let 1
|
||||
}
|
||||
0
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ class Case1() {
|
||||
|
||||
this.yield("") //UNRESOLVED_REFERENCE
|
||||
|
||||
this as SequenceScope<String>
|
||||
this <!USELESS_CAST!>as SequenceScope<String><!>
|
||||
|
||||
yield("") // resolved to SequenceScope.yield
|
||||
|
||||
@@ -31,10 +31,10 @@ fun case2() {
|
||||
|
||||
this.yield("") //UNRESOLVED_REFERENCE
|
||||
|
||||
this as SequenceScope<String>
|
||||
this <!USELESS_CAST!>as SequenceScope<String><!>
|
||||
|
||||
yield("") // UNRESOLVED_REFERENCE
|
||||
|
||||
this.yield("") // UNRESOLVED_REFERENCE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3159,6 +3159,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/problems/secondaryConstructorCfg.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("symbolsAndDescriptors.kt")
|
||||
public void testSymbolsAndDescriptors() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/problems/symbolsAndDescriptors.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("transform.kt")
|
||||
public void testTransform() throws Exception {
|
||||
@@ -5287,6 +5293,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("capturedTypeInEquality.kt")
|
||||
public void testCapturedTypeInEquality() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/capturedTypeInEquality.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("DeepCopyIrTree.kt")
|
||||
public void testDeepCopyIrTree() throws Exception {
|
||||
|
||||
@@ -3159,6 +3159,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/problems/secondaryConstructorCfg.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("symbolsAndDescriptors.kt")
|
||||
public void testSymbolsAndDescriptors() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/problems/symbolsAndDescriptors.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("transform.kt")
|
||||
public void testTransform() throws Exception {
|
||||
@@ -5287,6 +5293,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems"), Pattern.compile("^([^.]+)\\.kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("capturedTypeInEquality.kt")
|
||||
public void testCapturedTypeInEquality() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/capturedTypeInEquality.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("DeepCopyIrTree.kt")
|
||||
public void testDeepCopyIrTree() throws Exception {
|
||||
|
||||
@@ -620,6 +620,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/RecursiveTypeInference.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("RecursiveTypeParameterEqualityCheck.kt")
|
||||
public void testRecursiveTypeParameterEqualityCheck() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/RecursiveTypeParameterEqualityCheck.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ReserveYield.kt")
|
||||
public void testReserveYield() throws Exception {
|
||||
@@ -5680,6 +5686,136 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/callableReference/outsideSuspend.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class SuspendFunctionAsSupertype {
|
||||
@Test
|
||||
public void testAllFilesPresentInSuspendFunctionAsSupertype() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/kSuspendFunctionN")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class KSuspendFunctionN {
|
||||
@Test
|
||||
public void testAllFilesPresentInKSuspendFunctionN() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/kSuspendFunctionN"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypes.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypes() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/kSuspendFunctionN/mixingSuspendAndNonSuspendSupertypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperClass.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperClass() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/kSuspendFunctionN/mixingSuspendAndNonSuspendSupertypesThruSuperClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperFunInterface.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperFunInterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/kSuspendFunctionN/mixingSuspendAndNonSuspendSupertypesThruSuperFunInterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperinterface.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperinterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/kSuspendFunctionN/mixingSuspendAndNonSuspendSupertypesThruSuperinterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/kSuspendFunctionN/simple.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/simple")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Simple {
|
||||
@Test
|
||||
public void testAllFilesPresentInSimple() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/simple"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypes.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypes() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/simple/mixingSuspendAndNonSuspendSupertypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperClass.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperClass() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/simple/mixingSuspendAndNonSuspendSupertypesThruSuperClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperFunInterface.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperFunInterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/simple/mixingSuspendAndNonSuspendSupertypesThruSuperFunInterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperinterface.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperinterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/simple/mixingSuspendAndNonSuspendSupertypesThruSuperinterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/simple/simple.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/suspendFunctionN")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class SuspendFunctionN {
|
||||
@Test
|
||||
public void testAllFilesPresentInSuspendFunctionN() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/suspendFunctionN"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypes.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypes() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/suspendFunctionN/mixingSuspendAndNonSuspendSupertypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperClass.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperClass() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/suspendFunctionN/mixingSuspendAndNonSuspendSupertypesThruSuperClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperFunInterface.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperFunInterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/suspendFunctionN/mixingSuspendAndNonSuspendSupertypesThruSuperFunInterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperinterface.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperinterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/suspendFunctionN/mixingSuspendAndNonSuspendSupertypesThruSuperinterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/suspendFunctionN/simple.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@@ -8941,6 +9077,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/enum/starImportNestedClassAndEntries.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeCompatibility.kt")
|
||||
public void testTypeCompatibility() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/enum/typeCompatibility.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeParametersInEnum.kt")
|
||||
public void testTypeParametersInEnum() throws Exception {
|
||||
@@ -12457,6 +12599,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/inference/violatingUpperBoundForSelfType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("violatingUpperBoundForSelfTypeError.kt")
|
||||
public void testViolatingUpperBoundForSelfTypeError() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/violatingUpperBoundForSelfTypeError.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/inference/builderInference")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@@ -16710,6 +16858,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/java8Overrides/abstractBaseClassMemberNotImplemented.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("abstractBaseClassMemberNotImplemented_15.kt")
|
||||
public void testAbstractBaseClassMemberNotImplemented_15() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/java8Overrides/abstractBaseClassMemberNotImplemented_15.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("abstractVsAbstract.kt")
|
||||
public void testAbstractVsAbstract() throws Exception {
|
||||
@@ -16739,6 +16893,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/java8Overrides/implementingMethodOfAny.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt45508.kt")
|
||||
public void testKt45508() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/java8Overrides/kt45508.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("notAMethodOfAny.kt")
|
||||
public void testNotAMethodOfAny() throws Exception {
|
||||
@@ -21000,6 +21160,18 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/arrays.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("dontSubstituteAnotherErasedRecursiveTypeArgumentAndNonRecursive.kt")
|
||||
public void testDontSubstituteAnotherErasedRecursiveTypeArgumentAndNonRecursive() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/dontSubstituteAnotherErasedRecursiveTypeArgumentAndNonRecursive.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("dontSubstituteAnotherErasedTypeArgumentIfRecursive.kt")
|
||||
public void testDontSubstituteAnotherErasedTypeArgumentIfRecursive() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/dontSubstituteAnotherErasedTypeArgumentIfRecursive.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("errorType.kt")
|
||||
public void testErrorType() throws Exception {
|
||||
@@ -21090,6 +21262,30 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/starProjectionToRaw.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("substituteAnotherErasedTypeArgument.kt")
|
||||
public void testSubstituteAnotherErasedTypeArgument() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/substituteAnotherErasedTypeArgument.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("substituteOtherErasedDeepTypeArguments.kt")
|
||||
public void testSubstituteOtherErasedDeepTypeArguments() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/substituteOtherErasedDeepTypeArguments.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("substituteSeveralOtherErasedDependentTypeArguments.kt")
|
||||
public void testSubstituteSeveralOtherErasedDependentTypeArguments() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/substituteSeveralOtherErasedDependentTypeArguments.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("substituteSeveralOtherErasedTypeArguments.kt")
|
||||
public void testSubstituteSeveralOtherErasedTypeArguments() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/substituteSeveralOtherErasedTypeArguments.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeEnhancement.kt")
|
||||
public void testTypeEnhancement() throws Exception {
|
||||
@@ -29017,6 +29213,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/typeParameters/kt42042.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt42042Error.kt")
|
||||
public void testKt42042Error() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/typeParameters/kt42042Error.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt42396.kt")
|
||||
public void testKt42396() throws Exception {
|
||||
|
||||
@@ -620,6 +620,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/tests/RecursiveTypeInference.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("RecursiveTypeParameterEqualityCheck.kt")
|
||||
public void testRecursiveTypeParameterEqualityCheck() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/RecursiveTypeParameterEqualityCheck.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ReserveYield.kt")
|
||||
public void testReserveYield() throws Exception {
|
||||
@@ -5680,6 +5686,136 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/callableReference/outsideSuspend.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class SuspendFunctionAsSupertype {
|
||||
@Test
|
||||
public void testAllFilesPresentInSuspendFunctionAsSupertype() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/kSuspendFunctionN")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class KSuspendFunctionN {
|
||||
@Test
|
||||
public void testAllFilesPresentInKSuspendFunctionN() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/kSuspendFunctionN"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypes.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypes() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/kSuspendFunctionN/mixingSuspendAndNonSuspendSupertypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperClass.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperClass() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/kSuspendFunctionN/mixingSuspendAndNonSuspendSupertypesThruSuperClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperFunInterface.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperFunInterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/kSuspendFunctionN/mixingSuspendAndNonSuspendSupertypesThruSuperFunInterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperinterface.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperinterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/kSuspendFunctionN/mixingSuspendAndNonSuspendSupertypesThruSuperinterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/kSuspendFunctionN/simple.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/simple")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class Simple {
|
||||
@Test
|
||||
public void testAllFilesPresentInSimple() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/simple"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypes.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypes() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/simple/mixingSuspendAndNonSuspendSupertypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperClass.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperClass() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/simple/mixingSuspendAndNonSuspendSupertypesThruSuperClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperFunInterface.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperFunInterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/simple/mixingSuspendAndNonSuspendSupertypesThruSuperFunInterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperinterface.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperinterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/simple/mixingSuspendAndNonSuspendSupertypesThruSuperinterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/simple/simple.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/suspendFunctionN")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class SuspendFunctionN {
|
||||
@Test
|
||||
public void testAllFilesPresentInSuspendFunctionN() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/suspendFunctionN"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypes.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypes() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/suspendFunctionN/mixingSuspendAndNonSuspendSupertypes.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperClass.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperClass() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/suspendFunctionN/mixingSuspendAndNonSuspendSupertypesThruSuperClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperFunInterface.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperFunInterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/suspendFunctionN/mixingSuspendAndNonSuspendSupertypesThruSuperFunInterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("mixingSuspendAndNonSuspendSupertypesThruSuperinterface.kt")
|
||||
public void testMixingSuspendAndNonSuspendSupertypesThruSuperinterface() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/suspendFunctionN/mixingSuspendAndNonSuspendSupertypesThruSuperinterface.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/coroutines/suspendFunctionAsSupertype/suspendFunctionN/simple.kt");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@@ -8941,6 +9077,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/tests/enum/starImportNestedClassAndEntries.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeCompatibility.kt")
|
||||
public void testTypeCompatibility() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/enum/typeCompatibility.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeParametersInEnum.kt")
|
||||
public void testTypeParametersInEnum() throws Exception {
|
||||
@@ -12457,6 +12599,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/tests/inference/violatingUpperBoundForSelfType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("violatingUpperBoundForSelfTypeError.kt")
|
||||
public void testViolatingUpperBoundForSelfTypeError() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/violatingUpperBoundForSelfTypeError.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/diagnostics/tests/inference/builderInference")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@@ -16710,6 +16858,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/tests/java8Overrides/abstractBaseClassMemberNotImplemented.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("abstractBaseClassMemberNotImplemented_15.kt")
|
||||
public void testAbstractBaseClassMemberNotImplemented_15() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/java8Overrides/abstractBaseClassMemberNotImplemented_15.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("abstractVsAbstract.kt")
|
||||
public void testAbstractVsAbstract() throws Exception {
|
||||
@@ -16739,6 +16893,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/tests/java8Overrides/implementingMethodOfAny.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt45508.kt")
|
||||
public void testKt45508() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/java8Overrides/kt45508.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("notAMethodOfAny.kt")
|
||||
public void testNotAMethodOfAny() throws Exception {
|
||||
@@ -21000,6 +21160,18 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/arrays.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("dontSubstituteAnotherErasedRecursiveTypeArgumentAndNonRecursive.kt")
|
||||
public void testDontSubstituteAnotherErasedRecursiveTypeArgumentAndNonRecursive() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/dontSubstituteAnotherErasedRecursiveTypeArgumentAndNonRecursive.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("dontSubstituteAnotherErasedTypeArgumentIfRecursive.kt")
|
||||
public void testDontSubstituteAnotherErasedTypeArgumentIfRecursive() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/dontSubstituteAnotherErasedTypeArgumentIfRecursive.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("errorType.kt")
|
||||
public void testErrorType() throws Exception {
|
||||
@@ -21090,6 +21262,30 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/starProjectionToRaw.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("substituteAnotherErasedTypeArgument.kt")
|
||||
public void testSubstituteAnotherErasedTypeArgument() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/substituteAnotherErasedTypeArgument.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("substituteOtherErasedDeepTypeArguments.kt")
|
||||
public void testSubstituteOtherErasedDeepTypeArguments() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/substituteOtherErasedDeepTypeArguments.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("substituteSeveralOtherErasedDependentTypeArguments.kt")
|
||||
public void testSubstituteSeveralOtherErasedDependentTypeArguments() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/substituteSeveralOtherErasedDependentTypeArguments.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("substituteSeveralOtherErasedTypeArguments.kt")
|
||||
public void testSubstituteSeveralOtherErasedTypeArguments() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/platformTypes/rawTypes/substituteSeveralOtherErasedTypeArguments.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("typeEnhancement.kt")
|
||||
public void testTypeEnhancement() throws Exception {
|
||||
@@ -29017,6 +29213,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/tests/typeParameters/kt42042.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt42042Error.kt")
|
||||
public void testKt42042Error() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/typeParameters/kt42042Error.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt42396.kt")
|
||||
public void testKt42396() throws Exception {
|
||||
|
||||
@@ -94,7 +94,7 @@ class Generator(
|
||||
printPackageAndCopyright()
|
||||
printImports()
|
||||
printGeneratedMessage()
|
||||
println("internal class $composedComponentName : $checkersComponentName() {")
|
||||
println("class $composedComponentName : $checkersComponentName() {")
|
||||
withIndent {
|
||||
// public overrides
|
||||
for (alias in configuration.aliases.values) {
|
||||
@@ -122,7 +122,7 @@ class Generator(
|
||||
|
||||
// register function
|
||||
println(CHECKERS_COMPONENT_INTERNAL_ANNOTATION)
|
||||
println("internal fun register(checkers: $checkersComponentName) {")
|
||||
println("fun register(checkers: $checkersComponentName) {")
|
||||
withIndent {
|
||||
for (alias in configuration.aliases.values) {
|
||||
println("_${alias.fieldName} += checkers.${alias.fieldName}")
|
||||
|
||||
@@ -9,11 +9,17 @@ import org.jetbrains.kotlin.fir.checkers.generator.diagnostics.DIAGNOSTICS_LIST
|
||||
import org.jetbrains.kotlin.fir.checkers.generator.diagnostics.generateDiagnostics
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.expressions.*
|
||||
import org.jetbrains.kotlin.fir.types.FirTypeRef
|
||||
import java.io.File
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val generationPath = args.firstOrNull()?.let { File(it) } ?: File("compiler/fir/checkers/gen").absoluteFile
|
||||
|
||||
val typePackage = "org.jetbrains.kotlin.fir.analysis.checkers.type"
|
||||
generateCheckersComponents(generationPath, typePackage, "FirTypeChecker") {
|
||||
alias<FirTypeRef>("TypeRefChecker")
|
||||
}
|
||||
|
||||
val expressionPackage = "org.jetbrains.kotlin.fir.analysis.checkers.expression"
|
||||
generateCheckersComponents(generationPath, expressionPackage, "FirExpressionChecker") {
|
||||
alias<FirStatement>("BasicExpressionChecker")
|
||||
@@ -32,6 +38,8 @@ fun main(args: Array<String>) {
|
||||
alias<FirEqualityOperatorCall>("EqualityOperatorCallChecker")
|
||||
alias<FirAnonymousFunction>("AnonymousFunctionAsExpressionChecker")
|
||||
alias<FirStringConcatenationCall>("StringConcatenationCallChecker")
|
||||
alias<FirTypeOperatorCall>("TypeOperatorCallChecker")
|
||||
alias<FirResolvedQualifier>("ResolvedQualifierChecker")
|
||||
}
|
||||
|
||||
val declarationPackage = "org.jetbrains.kotlin.fir.analysis.checkers.declaration"
|
||||
|
||||
@@ -52,6 +52,7 @@ enum class PositioningStrategy(private val strategy: String? = null) {
|
||||
CONST_MODIFIER,
|
||||
ARRAY_ACCESS,
|
||||
SAFE_ACCESS,
|
||||
AS_TYPE,
|
||||
USELESS_ELVIS,
|
||||
NAME_OF_NAMED_ARGUMENT,
|
||||
VALUE_ARGUMENTS,
|
||||
@@ -67,6 +68,7 @@ enum class PositioningStrategy(private val strategy: String? = null) {
|
||||
FUN_MODIFIER,
|
||||
SUSPEND_MODIFIER,
|
||||
FUN_INTERFACE,
|
||||
RESERVED_UNDERSCORE,
|
||||
|
||||
;
|
||||
|
||||
|
||||
@@ -82,6 +82,10 @@ object DIAGNOSTICS_LIST : DiagnosticList() {
|
||||
val NO_THIS by error<PsiElement>()
|
||||
}
|
||||
|
||||
val CALL_RESOLUTION by object : DiagnosticGroup("Call resolution") {
|
||||
val CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS by error<KtExpression>()
|
||||
}
|
||||
|
||||
val SUPER by object : DiagnosticGroup("Super") {
|
||||
val SUPER_IS_NOT_AN_EXPRESSION by error<PsiElement>(PositioningStrategy.REFERENCED_NAME_BY_QUALIFIED)
|
||||
val SUPER_NOT_AVAILABLE by error<PsiElement>(PositioningStrategy.REFERENCED_NAME_BY_QUALIFIED)
|
||||
@@ -251,6 +255,8 @@ object DIAGNOSTICS_LIST : DiagnosticList() {
|
||||
val NAMED_PARAMETER_NOT_FOUND by error<KtValueArgument>(PositioningStrategy.NAME_OF_NAMED_ARGUMENT) {
|
||||
parameter<String>("name")
|
||||
}
|
||||
|
||||
val MANY_LAMBDA_EXPRESSION_ARGUMENTS by error<KtValueArgument>()
|
||||
}
|
||||
|
||||
val AMBIGUITY by object : DiagnosticGroup("Ambiguity") {
|
||||
@@ -354,6 +360,16 @@ object DIAGNOSTICS_LIST : DiagnosticList() {
|
||||
val MISPLACED_TYPE_PARAMETER_CONSTRAINTS by warning<KtTypeParameter>()
|
||||
|
||||
val DYNAMIC_UPPER_BOUND by error<KtTypeReference>()
|
||||
|
||||
val INCOMPATIBLE_TYPES by error<KtElement> {
|
||||
parameter<ConeKotlinType>("typeA")
|
||||
parameter<ConeKotlinType>("typeB")
|
||||
}
|
||||
|
||||
val INCOMPATIBLE_TYPES_WARNING by warning<KtElement> {
|
||||
parameter<ConeKotlinType>("typeA")
|
||||
parameter<ConeKotlinType>("typeB")
|
||||
}
|
||||
}
|
||||
|
||||
val REFLECTION by object : DiagnosticGroup("Reflection") {
|
||||
@@ -589,6 +605,9 @@ object DIAGNOSTICS_LIST : DiagnosticList() {
|
||||
val UNINITIALIZED_VARIABLE by error<KtSimpleNameExpression> {
|
||||
parameter<FirPropertySymbol>("variable")
|
||||
}
|
||||
val UNINITIALIZED_PARAMETER by error<KtSimpleNameExpression> {
|
||||
parameter<FirVariableSymbol<FirValueParameter>>("parameter")
|
||||
}
|
||||
val UNINITIALIZED_ENUM_ENTRY by error<KtSimpleNameExpression> {
|
||||
parameter<FirVariableSymbol<FirEnumEntry>>("enumEntry")
|
||||
}
|
||||
@@ -648,6 +667,13 @@ object DIAGNOSTICS_LIST : DiagnosticList() {
|
||||
val USELESS_ELVIS_RIGHT_IS_NULL by warning<KtBinaryExpression>(PositioningStrategy.USELESS_ELVIS)
|
||||
}
|
||||
|
||||
val CASTS_AND_IS_CHECKS by object : DiagnosticGroup("Casts and is-checks") {
|
||||
val USELESS_CAST by warning<KtBinaryExpressionWithTypeRHS>(PositioningStrategy.AS_TYPE)
|
||||
val USELESS_IS_CHECK by warning<KtElement> {
|
||||
parameter<Boolean>("compileTimeCheckResult")
|
||||
}
|
||||
}
|
||||
|
||||
val WHEN_EXPRESSIONS by object : DiagnosticGroup("When expressions") {
|
||||
val NO_ELSE_IN_WHEN by error<KtWhenExpression>(PositioningStrategy.WHEN_EXPRESSION) {
|
||||
parameter<List<WhenMissingCase>>("missingWhenCases")
|
||||
@@ -663,6 +689,10 @@ object DIAGNOSTICS_LIST : DiagnosticList() {
|
||||
val TYPE_PARAMETER_ON_LHS_OF_DOT by error<KtSimpleNameExpression> {
|
||||
parameter<FirTypeParameterSymbol>("typeParameter")
|
||||
}
|
||||
val NO_COMPANION_OBJECT by error<KtSimpleNameExpression>(PositioningStrategy.SELECTOR_BY_QUALIFIED) {
|
||||
parameter<FirRegularClassSymbol>("klass")
|
||||
}
|
||||
val EXPRESSION_EXPECTED_PACKAGE_FOUND by error<KtSimpleNameExpression>(PositioningStrategy.SELECTOR_BY_QUALIFIED)
|
||||
}
|
||||
|
||||
val FUNCTION_CONTRACTS by object : DiagnosticGroup("Function contracts") {
|
||||
@@ -696,6 +726,29 @@ object DIAGNOSTICS_LIST : DiagnosticList() {
|
||||
parameter<String>("expectedFunctionSignature")
|
||||
parameter<Collection<AbstractFirBasedSymbol<*>>>("candidates")
|
||||
}
|
||||
val DELEGATE_SPECIAL_FUNCTION_RETURN_TYPE_MISMATCH by error<KtExpression> {
|
||||
parameter<String>("delegateFunction")
|
||||
parameter<ConeKotlinType>("expected")
|
||||
parameter<ConeKotlinType>("actual")
|
||||
}
|
||||
|
||||
val UNDERSCORE_IS_RESERVED by error<KtExpression>(PositioningStrategy.RESERVED_UNDERSCORE)
|
||||
val UNDERSCORE_USAGE_WITHOUT_BACKTICKS by error<KtExpression>(PositioningStrategy.RESERVED_UNDERSCORE)
|
||||
|
||||
val EQUALITY_NOT_APPLICABLE by error<KtBinaryExpression> {
|
||||
parameter<String>("operator")
|
||||
parameter<ConeKotlinType>("leftType")
|
||||
parameter<ConeKotlinType>("rightType")
|
||||
}
|
||||
val EQUALITY_NOT_APPLICABLE_WARNING by warning<KtBinaryExpression> {
|
||||
parameter<String>("operator")
|
||||
parameter<ConeKotlinType>("leftType")
|
||||
parameter<ConeKotlinType>("rightType")
|
||||
}
|
||||
val INCOMPATIBLE_ENUM_COMPARISON_ERROR by error<KtElement> {
|
||||
parameter<ConeKotlinType>("leftType")
|
||||
parameter<ConeKotlinType>("rightType")
|
||||
}
|
||||
}
|
||||
|
||||
val TYPE_ALIAS by object : DiagnosticGroup("Type alias") {
|
||||
@@ -725,6 +778,49 @@ object DIAGNOSTICS_LIST : DiagnosticList() {
|
||||
val RETURN_NOT_ALLOWED by error<KtReturnExpression>(PositioningStrategy.RETURN_WITH_LABEL)
|
||||
val RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY by error<KtReturnExpression>(PositioningStrategy.RETURN_WITH_LABEL)
|
||||
}
|
||||
|
||||
val INLINE by object : DiagnosticGroup("Inline") {
|
||||
val USAGE_IS_NOT_INLINABLE by error<KtElement>(PositioningStrategy.REFERENCE_BY_QUALIFIED) {
|
||||
parameter<Symbol>("parameter")
|
||||
}
|
||||
|
||||
val NON_LOCAL_RETURN_NOT_ALLOWED by error<KtElement>(PositioningStrategy.REFERENCE_BY_QUALIFIED) {
|
||||
parameter<Symbol>("parameter")
|
||||
}
|
||||
|
||||
val RECURSION_IN_INLINE by error<KtElement>(PositioningStrategy.REFERENCE_BY_QUALIFIED) {
|
||||
parameter<Symbol>("symbol")
|
||||
}
|
||||
|
||||
val NON_PUBLIC_CALL_FROM_PUBLIC_INLINE by error<KtElement>(PositioningStrategy.REFERENCE_BY_QUALIFIED) {
|
||||
parameter<Symbol>("inlineDeclaration")
|
||||
parameter<Symbol>("referencedDeclaration")
|
||||
}
|
||||
|
||||
val PROTECTED_CONSTRUCTOR_CALL_FROM_PUBLIC_INLINE by error<KtElement>(PositioningStrategy.REFERENCE_BY_QUALIFIED) {
|
||||
parameter<Symbol>("inlineDeclaration")
|
||||
parameter<Symbol>("referencedDeclaration")
|
||||
}
|
||||
|
||||
val PROTECTED_CALL_FROM_PUBLIC_INLINE_ERROR by error<KtElement>(PositioningStrategy.REFERENCE_BY_QUALIFIED) {
|
||||
parameter<Symbol>("inlineDeclaration")
|
||||
parameter<Symbol>("referencedDeclaration")
|
||||
}
|
||||
|
||||
val PROTECTED_CALL_FROM_PUBLIC_INLINE by warning<KtElement>(PositioningStrategy.REFERENCE_BY_QUALIFIED) {
|
||||
parameter<Symbol>("inlineDeclaration")
|
||||
parameter<Symbol>("referencedDeclaration")
|
||||
}
|
||||
|
||||
val PRIVATE_CLASS_MEMBER_FROM_INLINE by error<KtElement>(PositioningStrategy.REFERENCE_BY_QUALIFIED) {
|
||||
parameter<Symbol>("inlineDeclaration")
|
||||
parameter<Symbol>("referencedDeclaration")
|
||||
}
|
||||
|
||||
val SUPER_CALL_FROM_PUBLIC_INLINE by warning<KtElement>(PositioningStrategy.REFERENCE_BY_QUALIFIED) {
|
||||
parameter<Symbol>("symbol")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val exposedVisibilityDiagnosticInit: DiagnosticBuilder.() -> Unit = {
|
||||
|
||||
@@ -14,7 +14,7 @@ import org.jetbrains.kotlin.fir.analysis.checkers.cfa.FirControlFlowChecker
|
||||
* DO NOT MODIFY IT MANUALLY
|
||||
*/
|
||||
|
||||
internal class ComposedDeclarationCheckers : DeclarationCheckers() {
|
||||
class ComposedDeclarationCheckers : DeclarationCheckers() {
|
||||
override val basicDeclarationCheckers: Set<FirBasicDeclarationChecker>
|
||||
get() = _basicDeclarationCheckers
|
||||
override val memberDeclarationCheckers: Set<FirMemberDeclarationChecker>
|
||||
@@ -54,7 +54,7 @@ internal class ComposedDeclarationCheckers : DeclarationCheckers() {
|
||||
private val _variableAssignmentCfaBasedCheckers: MutableSet<AbstractFirPropertyInitializationChecker> = mutableSetOf()
|
||||
|
||||
@CheckersComponentInternal
|
||||
internal fun register(checkers: DeclarationCheckers) {
|
||||
fun register(checkers: DeclarationCheckers) {
|
||||
_basicDeclarationCheckers += checkers.basicDeclarationCheckers
|
||||
_memberDeclarationCheckers += checkers.memberDeclarationCheckers
|
||||
_functionCheckers += checkers.functionCheckers
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.jetbrains.kotlin.fir.analysis.CheckersComponentInternal
|
||||
* DO NOT MODIFY IT MANUALLY
|
||||
*/
|
||||
|
||||
internal class ComposedExpressionCheckers : ExpressionCheckers() {
|
||||
class ComposedExpressionCheckers : ExpressionCheckers() {
|
||||
override val basicExpressionCheckers: Set<FirBasicExpressionChecker>
|
||||
get() = _basicExpressionCheckers
|
||||
override val qualifiedAccessCheckers: Set<FirQualifiedAccessChecker>
|
||||
@@ -45,6 +45,10 @@ internal class ComposedExpressionCheckers : ExpressionCheckers() {
|
||||
get() = _anonymousFunctionAsExpressionCheckers
|
||||
override val stringConcatenationCallCheckers: Set<FirStringConcatenationCallChecker>
|
||||
get() = _stringConcatenationCallCheckers
|
||||
override val typeOperatorCallCheckers: Set<FirTypeOperatorCallChecker>
|
||||
get() = _typeOperatorCallCheckers
|
||||
override val resolvedQualifierCheckers: Set<FirResolvedQualifierChecker>
|
||||
get() = _resolvedQualifierCheckers
|
||||
|
||||
private val _basicExpressionCheckers: MutableSet<FirBasicExpressionChecker> = mutableSetOf()
|
||||
private val _qualifiedAccessCheckers: MutableSet<FirQualifiedAccessChecker> = mutableSetOf()
|
||||
@@ -62,9 +66,11 @@ internal class ComposedExpressionCheckers : ExpressionCheckers() {
|
||||
private val _equalityOperatorCallCheckers: MutableSet<FirEqualityOperatorCallChecker> = mutableSetOf()
|
||||
private val _anonymousFunctionAsExpressionCheckers: MutableSet<FirAnonymousFunctionAsExpressionChecker> = mutableSetOf()
|
||||
private val _stringConcatenationCallCheckers: MutableSet<FirStringConcatenationCallChecker> = mutableSetOf()
|
||||
private val _typeOperatorCallCheckers: MutableSet<FirTypeOperatorCallChecker> = mutableSetOf()
|
||||
private val _resolvedQualifierCheckers: MutableSet<FirResolvedQualifierChecker> = mutableSetOf()
|
||||
|
||||
@CheckersComponentInternal
|
||||
internal fun register(checkers: ExpressionCheckers) {
|
||||
fun register(checkers: ExpressionCheckers) {
|
||||
_basicExpressionCheckers += checkers.basicExpressionCheckers
|
||||
_qualifiedAccessCheckers += checkers.qualifiedAccessCheckers
|
||||
_functionCallCheckers += checkers.functionCallCheckers
|
||||
@@ -81,5 +87,7 @@ internal class ComposedExpressionCheckers : ExpressionCheckers() {
|
||||
_equalityOperatorCallCheckers += checkers.equalityOperatorCallCheckers
|
||||
_anonymousFunctionAsExpressionCheckers += checkers.anonymousFunctionAsExpressionCheckers
|
||||
_stringConcatenationCallCheckers += checkers.stringConcatenationCallCheckers
|
||||
_typeOperatorCallCheckers += checkers.typeOperatorCallCheckers
|
||||
_resolvedQualifierCheckers += checkers.resolvedQualifierCheckers
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@ abstract class ExpressionCheckers {
|
||||
open val equalityOperatorCallCheckers: Set<FirEqualityOperatorCallChecker> = emptySet()
|
||||
open val anonymousFunctionAsExpressionCheckers: Set<FirAnonymousFunctionAsExpressionChecker> = emptySet()
|
||||
open val stringConcatenationCallCheckers: Set<FirStringConcatenationCallChecker> = emptySet()
|
||||
open val typeOperatorCallCheckers: Set<FirTypeOperatorCallChecker> = emptySet()
|
||||
open val resolvedQualifierCheckers: Set<FirResolvedQualifierChecker> = emptySet()
|
||||
|
||||
@CheckersComponentInternal internal val allBasicExpressionCheckers: Set<FirBasicExpressionChecker> get() = basicExpressionCheckers
|
||||
@CheckersComponentInternal internal val allQualifiedAccessCheckers: Set<FirQualifiedAccessChecker> get() = qualifiedAccessCheckers + basicExpressionCheckers
|
||||
@@ -50,4 +52,6 @@ abstract class ExpressionCheckers {
|
||||
@CheckersComponentInternal internal val allEqualityOperatorCallCheckers: Set<FirEqualityOperatorCallChecker> get() = equalityOperatorCallCheckers + basicExpressionCheckers
|
||||
@CheckersComponentInternal internal val allAnonymousFunctionAsExpressionCheckers: Set<FirAnonymousFunctionAsExpressionChecker> get() = anonymousFunctionAsExpressionCheckers + basicExpressionCheckers
|
||||
@CheckersComponentInternal internal val allStringConcatenationCallCheckers: Set<FirStringConcatenationCallChecker> get() = stringConcatenationCallCheckers + basicExpressionCheckers
|
||||
@CheckersComponentInternal internal val allTypeOperatorCallCheckers: Set<FirTypeOperatorCallChecker> get() = typeOperatorCallCheckers + basicExpressionCheckers
|
||||
@CheckersComponentInternal internal val allResolvedQualifierCheckers: Set<FirResolvedQualifierChecker> get() = resolvedQualifierCheckers + basicExpressionCheckers
|
||||
}
|
||||
|
||||
@@ -19,11 +19,13 @@ import org.jetbrains.kotlin.fir.expressions.FirEqualityOperatorCall
|
||||
import org.jetbrains.kotlin.fir.expressions.FirFunctionCall
|
||||
import org.jetbrains.kotlin.fir.expressions.FirGetClassCall
|
||||
import org.jetbrains.kotlin.fir.expressions.FirQualifiedAccessExpression
|
||||
import org.jetbrains.kotlin.fir.expressions.FirResolvedQualifier
|
||||
import org.jetbrains.kotlin.fir.expressions.FirReturnExpression
|
||||
import org.jetbrains.kotlin.fir.expressions.FirSafeCallExpression
|
||||
import org.jetbrains.kotlin.fir.expressions.FirStatement
|
||||
import org.jetbrains.kotlin.fir.expressions.FirStringConcatenationCall
|
||||
import org.jetbrains.kotlin.fir.expressions.FirTryExpression
|
||||
import org.jetbrains.kotlin.fir.expressions.FirTypeOperatorCall
|
||||
import org.jetbrains.kotlin.fir.expressions.FirVariableAssignment
|
||||
import org.jetbrains.kotlin.fir.expressions.FirWhenExpression
|
||||
|
||||
@@ -43,3 +45,5 @@ typealias FirSafeCallExpressionChecker = FirExpressionChecker<FirSafeCallExpress
|
||||
typealias FirEqualityOperatorCallChecker = FirExpressionChecker<FirEqualityOperatorCall>
|
||||
typealias FirAnonymousFunctionAsExpressionChecker = FirExpressionChecker<FirAnonymousFunction>
|
||||
typealias FirStringConcatenationCallChecker = FirExpressionChecker<FirStringConcatenationCall>
|
||||
typealias FirTypeOperatorCallChecker = FirExpressionChecker<FirTypeOperatorCall>
|
||||
typealias FirResolvedQualifierChecker = FirExpressionChecker<FirResolvedQualifier>
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.fir.analysis.checkers.type
|
||||
|
||||
import org.jetbrains.kotlin.fir.analysis.CheckersComponentInternal
|
||||
|
||||
/*
|
||||
* This file was generated automatically
|
||||
* DO NOT MODIFY IT MANUALLY
|
||||
*/
|
||||
|
||||
class ComposedTypeCheckers : TypeCheckers() {
|
||||
override val typeRefCheckers: Set<FirTypeRefChecker>
|
||||
get() = _typeRefCheckers
|
||||
|
||||
private val _typeRefCheckers: MutableSet<FirTypeRefChecker> = mutableSetOf()
|
||||
|
||||
@CheckersComponentInternal
|
||||
fun register(checkers: TypeCheckers) {
|
||||
_typeRefCheckers += checkers.typeRefCheckers
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.fir.analysis.checkers.type
|
||||
|
||||
/*
|
||||
* This file was generated automatically
|
||||
* DO NOT MODIFY IT MANUALLY
|
||||
*/
|
||||
|
||||
import org.jetbrains.kotlin.fir.types.FirTypeRef
|
||||
|
||||
typealias FirTypeRefChecker = FirTypeChecker<FirTypeRef>
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.fir.analysis.checkers.type
|
||||
|
||||
import org.jetbrains.kotlin.fir.analysis.CheckersComponentInternal
|
||||
|
||||
/*
|
||||
* This file was generated automatically
|
||||
* DO NOT MODIFY IT MANUALLY
|
||||
*/
|
||||
|
||||
abstract class TypeCheckers {
|
||||
companion object {
|
||||
val EMPTY: TypeCheckers = object : TypeCheckers() {}
|
||||
}
|
||||
|
||||
open val typeRefCheckers: Set<FirTypeRefChecker> = emptySet()
|
||||
|
||||
@CheckersComponentInternal internal val allTypeRefCheckers: Set<FirTypeRefChecker> get() = typeRefCheckers
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user