mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-04-24 08:31:31 +00:00
Compare commits
249 Commits
rr/stdlib/
...
rr/ileasil
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b385fe2c7 | ||
|
|
dd3d6a86a9 | ||
|
|
bbf5c4412e | ||
|
|
7f2c5cde55 | ||
|
|
d06031ece3 | ||
|
|
cc1cb463b2 | ||
|
|
b60056f11e | ||
|
|
c73c73e85e | ||
|
|
cd890d5833 | ||
|
|
85949b387e | ||
|
|
a9ff030c73 | ||
|
|
2cb9d1f287 | ||
|
|
6a586fb731 | ||
|
|
75bf5fdbfe | ||
|
|
253c389f4a | ||
|
|
ae902e6fe5 | ||
|
|
fb14b03824 | ||
|
|
d6907222cd | ||
|
|
8805675539 | ||
|
|
c198c57e62 | ||
|
|
f38c0cf348 | ||
|
|
6592407492 | ||
|
|
051e2b0869 | ||
|
|
a9399535fb | ||
|
|
38ab37d7eb | ||
|
|
37db27da58 | ||
|
|
f1280a63d3 | ||
|
|
dd20dd9806 | ||
|
|
c680ee8525 | ||
|
|
0d9991ebcd | ||
|
|
5609645156 | ||
|
|
f795a9c4ff | ||
|
|
6c52d95342 | ||
|
|
a5e445492f | ||
|
|
b903f87704 | ||
|
|
998a65d1cb | ||
|
|
455773299b | ||
|
|
c17b6c59f8 | ||
|
|
770401801b | ||
|
|
295858cf5c | ||
|
|
7d4b8587a3 | ||
|
|
221b6bd184 | ||
|
|
c74f471a82 | ||
|
|
bfc7eb7bab | ||
|
|
8d8ed4cc18 | ||
|
|
6769ce0e2b | ||
|
|
6ca005cd70 | ||
|
|
19708cfa87 | ||
|
|
1123f97a15 | ||
|
|
f7829d0bea | ||
|
|
e232a2be6c | ||
|
|
2b7866402d | ||
|
|
6e3b1fd919 | ||
|
|
914ce22f6b | ||
|
|
a0557ad937 | ||
|
|
7f9fe6b332 | ||
|
|
e44877f562 | ||
|
|
096e715652 | ||
|
|
2f49e8e0af | ||
|
|
648bf99842 | ||
|
|
ff4d193891 | ||
|
|
9934cfbb00 | ||
|
|
c830aed946 | ||
|
|
22d6433cf6 | ||
|
|
e56ac775ca | ||
|
|
9c38db754e | ||
|
|
731e3ebae1 | ||
|
|
df08ed2ac0 | ||
|
|
5485c372e8 | ||
|
|
211ddd307c | ||
|
|
49a4ec7f92 | ||
|
|
a4cf21adef | ||
|
|
a22a6b4338 | ||
|
|
baad0d698f | ||
|
|
ddc12834cb | ||
|
|
51393d2d0f | ||
|
|
5e6f52009f | ||
|
|
0aca68e7c7 | ||
|
|
991e5210ba | ||
|
|
5acd72d5a5 | ||
|
|
39b11f6ef0 | ||
|
|
ad7c8b7a07 | ||
|
|
37aedba7ef | ||
|
|
0406659ac8 | ||
|
|
24ce6957a9 | ||
|
|
0a732869e9 | ||
|
|
0119541462 | ||
|
|
0a59301f8a | ||
|
|
896e77cd32 | ||
|
|
ac8b4c1b79 | ||
|
|
88058ca2c8 | ||
|
|
7b639235a2 | ||
|
|
ae4dd80254 | ||
|
|
9ac6d30953 | ||
|
|
bcd7bc5fd7 | ||
|
|
c3ec94ff82 | ||
|
|
2d9c0e137f | ||
|
|
a11f6d2e50 | ||
|
|
3400911d97 | ||
|
|
4a79f544f7 | ||
|
|
7e08820009 | ||
|
|
14121a1d9a | ||
|
|
20fdad87ec | ||
|
|
ef2bb48706 | ||
|
|
51a1cec08b | ||
|
|
3e458a1efb | ||
|
|
f8d50d585d | ||
|
|
7d29ae7cce | ||
|
|
6cc39788fd | ||
|
|
88e7ba2a3b | ||
|
|
ed78183dbd | ||
|
|
77539fe2db | ||
|
|
e0297cf207 | ||
|
|
76b2ca2e96 | ||
|
|
81a8566763 | ||
|
|
41f5ac393a | ||
|
|
48599e3768 | ||
|
|
6e31ff4fb1 | ||
|
|
6f887896ff | ||
|
|
f66a155683 | ||
|
|
a618791ff0 | ||
|
|
246a907753 | ||
|
|
56bec6997c | ||
|
|
6134c00698 | ||
|
|
5243720043 | ||
|
|
3a008f6236 | ||
|
|
273b43d227 | ||
|
|
51d3d1f1a8 | ||
|
|
f339e9cc66 | ||
|
|
30863cd184 | ||
|
|
0e1276fc6c | ||
|
|
58e0cc1c7c | ||
|
|
579c1eb7db | ||
|
|
e1c80ac75c | ||
|
|
651fd4ad9f | ||
|
|
449a79151a | ||
|
|
82b8cc333e | ||
|
|
47d2a914bc | ||
|
|
9ce8420491 | ||
|
|
9ae41f5c07 | ||
|
|
4768700600 | ||
|
|
b6f1a442fb | ||
|
|
a26a195c35 | ||
|
|
c6298398ef | ||
|
|
4f1ed2f112 | ||
|
|
178910a2e5 | ||
|
|
e0a8e9a664 | ||
|
|
999d1f982e | ||
|
|
80ac62864d | ||
|
|
b5d3f9ee31 | ||
|
|
7a66e22bb2 | ||
|
|
8068a5439f | ||
|
|
3d236b7171 | ||
|
|
b385650bf0 | ||
|
|
4107378d2c | ||
|
|
fef1892219 | ||
|
|
a113df8c43 | ||
|
|
f318951b64 | ||
|
|
fae0aa42c4 | ||
|
|
940774caaf | ||
|
|
14d386223b | ||
|
|
ae5fefce51 | ||
|
|
e00e726bcb | ||
|
|
f4afc2ef44 | ||
|
|
b0969f626e | ||
|
|
714871e4a5 | ||
|
|
7dc3be3b9b | ||
|
|
50f2666eba | ||
|
|
ee7c90791e | ||
|
|
de03124f50 | ||
|
|
21b1d97b30 | ||
|
|
3b6d3e5a08 | ||
|
|
094287741c | ||
|
|
9aa16faa27 | ||
|
|
dfd3b54ee4 | ||
|
|
7fe0df2816 | ||
|
|
4f250ed498 | ||
|
|
0f2aca3280 | ||
|
|
d46ad6c0ad | ||
|
|
5abc45e6ff | ||
|
|
823d2d0748 | ||
|
|
ea01c97a8e | ||
|
|
5baa2e0e7c | ||
|
|
062adf21de | ||
|
|
e9298d1d71 | ||
|
|
14ca2d207d | ||
|
|
164d7d80b6 | ||
|
|
3ebdfa3850 | ||
|
|
1b649fa4cb | ||
|
|
05deecaafa | ||
|
|
482c677274 | ||
|
|
7c4225b9d1 | ||
|
|
752be27557 | ||
|
|
818659f2bb | ||
|
|
886e3e6655 | ||
|
|
499ffd610a | ||
|
|
ac8d135a21 | ||
|
|
3ce00f6eb4 | ||
|
|
b5f9b1dfc0 | ||
|
|
dac218dc39 | ||
|
|
3124a4ddae | ||
|
|
571971c5db | ||
|
|
911c24d594 | ||
|
|
0730833135 | ||
|
|
ce239ccc3e | ||
|
|
2a7ccb11e8 | ||
|
|
a471bbc185 | ||
|
|
39d748dbbb | ||
|
|
32be3cc703 | ||
|
|
58a5f4f90b | ||
|
|
b838ba8c62 | ||
|
|
9c97f1ce35 | ||
|
|
6473d2a7c8 | ||
|
|
c38a793352 | ||
|
|
3154234107 | ||
|
|
093c8bfbb6 | ||
|
|
75e4c74256 | ||
|
|
93f711e2b8 | ||
|
|
9f0af3faba | ||
|
|
801d4a0c77 | ||
|
|
dcf64779a9 | ||
|
|
3bcc2fe476 | ||
|
|
164e9034d1 | ||
|
|
8ba4f060f0 | ||
|
|
7e18b69e7d | ||
|
|
4222fb9629 | ||
|
|
ec23ebd1c5 | ||
|
|
4826e3278f | ||
|
|
7b482bf70a | ||
|
|
1d63dccfae | ||
|
|
a7b0c6c821 | ||
|
|
0bb37db4bf | ||
|
|
846dc1b9b9 | ||
|
|
ae6eeb2501 | ||
|
|
443a14756f | ||
|
|
ceed3e7355 | ||
|
|
010f1cb634 | ||
|
|
8bf339a7cf | ||
|
|
502087a3c7 | ||
|
|
b6d334b303 | ||
|
|
c06bcbad39 | ||
|
|
bafc61b56f | ||
|
|
db64884bd0 | ||
|
|
439e54aee6 | ||
|
|
cf30be5957 | ||
|
|
08433b9ac9 | ||
|
|
4d5da26696 | ||
|
|
5e14aa34ec | ||
|
|
0dc5ed53f8 |
21
.idea/runConfigurations/Generate_FIR_tree.xml
generated
Normal file
21
.idea/runConfigurations/Generate_FIR_tree.xml
generated
Normal file
@@ -0,0 +1,21 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Generate FIR tree" type="GradleRunConfiguration" factoryName="Gradle" folderName="Generators">
|
||||
<ExternalSystemSettings>
|
||||
<option name="executionName" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$/compiler/fir/tree" />
|
||||
<option name="externalSystemIdString" value="GRADLE" />
|
||||
<option name="scriptParameters" value="" />
|
||||
<option name="taskDescriptions">
|
||||
<list />
|
||||
</option>
|
||||
<option name="taskNames">
|
||||
<list>
|
||||
<option value="generateTree" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="vmOptions" value="" />
|
||||
</ExternalSystemSettings>
|
||||
<GradleScriptDebugEnabled>true</GradleScriptDebugEnabled>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
21
ReadMe.md
21
ReadMe.md
@@ -147,6 +147,27 @@ From this root project there are Run/Debug Configurations for running `IDEA` or
|
||||
* Run the `IDEA` run configuration in the project
|
||||
* A child IntelliJ IDEA with the Kotlin plugin will then startup
|
||||
|
||||
### Dependency verification
|
||||
|
||||
We have a [dependencies verification](https://docs.gradle.org/current/userguide/dependency_verification.html) feature enabled in the
|
||||
repository for all Gradle builds. Gradle will check hashes (md5 and sha256) of used dependencies and will fail builds with
|
||||
`Dependency verification failed` errors when local artifacts are absent or have different hashes listed in the
|
||||
[verification-metadata.xml](https://github.com/JetBrains/kotlin/blob/master/gradle/verification-metadata.xml) file.
|
||||
|
||||
It's expected that `verification-metadata.xml` should only be updated with the commits that modify the build. There are some tips how
|
||||
to perform such updates:
|
||||
|
||||
- Use auto-generation for getting an initial list of new hashes (verify updates relate to you changes).
|
||||
|
||||
`./gradlew -M sha256,md5 help`
|
||||
|
||||
*(any other task may be used instead of `help`)*
|
||||
|
||||
- Consider removing old versions from the file if you are updating dependencies.
|
||||
- Leave meaningful `origin` attribute (instead of `Generated by Gradle`) if you did some manual verification of the artifact.
|
||||
- Always do manual verification if several hashes are needed and a new `also-trust` tag has to be added.
|
||||
- If you’re adding a dependency with OS mentioning in an artifact name (`darwin`, `mac`, `osx`, `linux`, `windows`), remember to add
|
||||
counterparts for other platforms.
|
||||
|
||||
# License
|
||||
Kotlin is distributed under the terms of the Apache License (Version 2.0). See [license folder](license/README.md) for details.
|
||||
|
||||
@@ -1,36 +1,11 @@
|
||||
import kotlinx.benchmark.gradle.benchmark
|
||||
|
||||
val benchmarks_version = "0.2.0-dev-7"
|
||||
buildscript {
|
||||
val benchmarks_version = "0.2.0-dev-7"
|
||||
|
||||
repositories {
|
||||
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
|
||||
if (cacheRedirectorEnabled) {
|
||||
maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlinx")
|
||||
} else {
|
||||
maven("https://dl.bintray.com/kotlin/kotlinx")
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath("org.jetbrains.kotlinx:kotlinx.benchmark.gradle:$benchmarks_version")
|
||||
}
|
||||
}
|
||||
|
||||
apply(plugin = "kotlinx.benchmark")
|
||||
val benchmarks_version = "0.3.0"
|
||||
|
||||
plugins {
|
||||
java
|
||||
kotlin("jvm")
|
||||
}
|
||||
|
||||
repositories {
|
||||
val cacheRedirectorEnabled = findProperty("cacheRedirectorEnabled")?.toString()?.toBoolean() == true
|
||||
if (cacheRedirectorEnabled) {
|
||||
maven("https://cache-redirector.jetbrains.com/dl.bintray.com/kotlin/kotlinx")
|
||||
} else {
|
||||
maven("https://dl.bintray.com/kotlin/kotlinx")
|
||||
}
|
||||
id("org.jetbrains.kotlinx.benchmark") version "0.3.0"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -42,7 +17,7 @@ dependencies {
|
||||
compile(jpsStandalone()) { includeJars("jps-model") }
|
||||
compile(intellijPluginDep("java"))
|
||||
compile(intellijDep()) { includeIntellijCoreJarDependencies(project) }
|
||||
compile("org.jetbrains.kotlinx:kotlinx.benchmark.runtime-jvm:$benchmarks_version")
|
||||
compile("org.jetbrains.kotlinx:kotlinx-benchmark-runtime:$benchmarks_version")
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil
|
||||
import org.jetbrains.kotlin.metadata.jvm.deserialization.ModuleMapping
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.SpecialNames.DEFAULT_NAME_FOR_COMPANION_OBJECT
|
||||
import org.jetbrains.kotlin.resolve.jvm.AsmTypes
|
||||
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
|
||||
import org.jetbrains.org.objectweb.asm.*
|
||||
@@ -399,7 +400,9 @@ open class IncrementalJvmCache(
|
||||
}
|
||||
|
||||
for (const in oldMap.keys + newMap.keys) {
|
||||
changesCollector.collectMemberIfValueWasChanged(kotlinClass.scopeFqName(), const, oldMap[const], newMap[const])
|
||||
//Constant can be declared via companion object or via const field declaration
|
||||
changesCollector.collectMemberIfValueWasChanged(kotlinClass.scopeFqName(companion = true), const, oldMap[const], newMap[const])
|
||||
changesCollector.collectMemberIfValueWasChanged(kotlinClass.scopeFqName(companion = false), const, oldMap[const], newMap[const])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -599,11 +602,12 @@ sealed class ChangeInfo(val fqName: FqName) {
|
||||
}
|
||||
}
|
||||
|
||||
private fun LocalFileKotlinClass.scopeFqName() =
|
||||
when (classHeader.kind) {
|
||||
KotlinClassHeader.Kind.CLASS -> className.fqNameForClassNameWithoutDollars
|
||||
else -> className.packageFqName
|
||||
private fun LocalFileKotlinClass.scopeFqName(companion: Boolean = false) = when (classHeader.kind) {
|
||||
KotlinClassHeader.Kind.CLASS -> {
|
||||
className.fqNameForClassNameWithoutDollars.let { if (companion) it.child(DEFAULT_NAME_FOR_COMPANION_OBJECT) else it }
|
||||
}
|
||||
else -> className.packageFqName
|
||||
}
|
||||
|
||||
fun ByteArray.md5(): Long {
|
||||
val d = MessageDigest.getInstance("MD5").digest(this)!!
|
||||
|
||||
@@ -182,6 +182,21 @@ open class ProtoCompareGenerated(
|
||||
|
||||
if (!checkEqualsClassSealedSubclassFqName(old, new)) return false
|
||||
|
||||
if (old.hasInlineClassUnderlyingPropertyName() != new.hasInlineClassUnderlyingPropertyName()) return false
|
||||
if (old.hasInlineClassUnderlyingPropertyName()) {
|
||||
if (!checkStringEquals(old.inlineClassUnderlyingPropertyName, new.inlineClassUnderlyingPropertyName)) return false
|
||||
}
|
||||
|
||||
if (old.hasInlineClassUnderlyingType() != new.hasInlineClassUnderlyingType()) return false
|
||||
if (old.hasInlineClassUnderlyingType()) {
|
||||
if (!checkEquals(old.inlineClassUnderlyingType, new.inlineClassUnderlyingType)) return false
|
||||
}
|
||||
|
||||
if (old.hasInlineClassUnderlyingTypeId() != new.hasInlineClassUnderlyingTypeId()) return false
|
||||
if (old.hasInlineClassUnderlyingTypeId()) {
|
||||
if (!checkEquals(oldTypeTable.getType(old.inlineClassUnderlyingTypeId), newTypeTable.getType(new.inlineClassUnderlyingTypeId))) return false
|
||||
}
|
||||
|
||||
if (!checkEqualsClassVersionRequirement(old, new)) return false
|
||||
|
||||
if (old.hasVersionRequirementTable() != new.hasVersionRequirementTable()) return false
|
||||
@@ -266,6 +281,9 @@ open class ProtoCompareGenerated(
|
||||
TYPE_ALIAS_LIST,
|
||||
ENUM_ENTRY_LIST,
|
||||
SEALED_SUBCLASS_FQ_NAME_LIST,
|
||||
INLINE_CLASS_UNDERLYING_PROPERTY_NAME,
|
||||
INLINE_CLASS_UNDERLYING_TYPE,
|
||||
INLINE_CLASS_UNDERLYING_TYPE_ID,
|
||||
VERSION_REQUIREMENT_LIST,
|
||||
VERSION_REQUIREMENT_TABLE,
|
||||
JVM_EXT_CLASS_MODULE_NAME,
|
||||
@@ -314,6 +332,21 @@ open class ProtoCompareGenerated(
|
||||
|
||||
if (!checkEqualsClassSealedSubclassFqName(old, new)) result.add(ProtoBufClassKind.SEALED_SUBCLASS_FQ_NAME_LIST)
|
||||
|
||||
if (old.hasInlineClassUnderlyingPropertyName() != new.hasInlineClassUnderlyingPropertyName()) result.add(ProtoBufClassKind.INLINE_CLASS_UNDERLYING_PROPERTY_NAME)
|
||||
if (old.hasInlineClassUnderlyingPropertyName()) {
|
||||
if (!checkStringEquals(old.inlineClassUnderlyingPropertyName, new.inlineClassUnderlyingPropertyName)) result.add(ProtoBufClassKind.INLINE_CLASS_UNDERLYING_PROPERTY_NAME)
|
||||
}
|
||||
|
||||
if (old.hasInlineClassUnderlyingType() != new.hasInlineClassUnderlyingType()) result.add(ProtoBufClassKind.INLINE_CLASS_UNDERLYING_TYPE)
|
||||
if (old.hasInlineClassUnderlyingType()) {
|
||||
if (!checkEquals(old.inlineClassUnderlyingType, new.inlineClassUnderlyingType)) result.add(ProtoBufClassKind.INLINE_CLASS_UNDERLYING_TYPE)
|
||||
}
|
||||
|
||||
if (old.hasInlineClassUnderlyingTypeId() != new.hasInlineClassUnderlyingTypeId()) result.add(ProtoBufClassKind.INLINE_CLASS_UNDERLYING_TYPE_ID)
|
||||
if (old.hasInlineClassUnderlyingTypeId()) {
|
||||
if (!checkEquals(oldTypeTable.getType(old.inlineClassUnderlyingTypeId), newTypeTable.getType(new.inlineClassUnderlyingTypeId))) result.add(ProtoBufClassKind.INLINE_CLASS_UNDERLYING_TYPE_ID)
|
||||
}
|
||||
|
||||
if (!checkEqualsClassVersionRequirement(old, new)) result.add(ProtoBufClassKind.VERSION_REQUIREMENT_LIST)
|
||||
|
||||
if (old.hasVersionRequirementTable() != new.hasVersionRequirementTable()) result.add(ProtoBufClassKind.VERSION_REQUIREMENT_TABLE)
|
||||
@@ -1728,6 +1761,18 @@ fun ProtoBuf.Class.hashCode(stringIndexes: (Int) -> Int, fqNameIndexes: (Int) ->
|
||||
hashCode = 31 * hashCode + fqNameIndexes(getSealedSubclassFqName(i))
|
||||
}
|
||||
|
||||
if (hasInlineClassUnderlyingPropertyName()) {
|
||||
hashCode = 31 * hashCode + stringIndexes(inlineClassUnderlyingPropertyName)
|
||||
}
|
||||
|
||||
if (hasInlineClassUnderlyingType()) {
|
||||
hashCode = 31 * hashCode + inlineClassUnderlyingType.hashCode(stringIndexes, fqNameIndexes, typeById)
|
||||
}
|
||||
|
||||
if (hasInlineClassUnderlyingTypeId()) {
|
||||
hashCode = 31 * hashCode + typeById(inlineClassUnderlyingTypeId).hashCode(stringIndexes, fqNameIndexes, typeById)
|
||||
}
|
||||
|
||||
for(i in 0..versionRequirementCount - 1) {
|
||||
hashCode = 31 * hashCode + getVersionRequirement(i)
|
||||
}
|
||||
|
||||
@@ -290,6 +290,11 @@ class DifferenceCalculatorForClass(
|
||||
isClassAffected = true
|
||||
areSubclassesAffected = true
|
||||
}
|
||||
ProtoBufClassKind.INLINE_CLASS_UNDERLYING_PROPERTY_NAME,
|
||||
ProtoBufClassKind.INLINE_CLASS_UNDERLYING_TYPE,
|
||||
ProtoBufClassKind.INLINE_CLASS_UNDERLYING_TYPE_ID -> {
|
||||
isClassAffected = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,8 @@ data class BuildLogFinder(
|
||||
private val isGradleEnabled: Boolean = false,
|
||||
private val isJsEnabled: Boolean = false,
|
||||
private val isScopeExpansionEnabled: Boolean = false,
|
||||
private val isKlibEnabled: Boolean = false
|
||||
private val isKlibEnabled: Boolean = false,
|
||||
private val isFirEnabled: Boolean = false
|
||||
) {
|
||||
companion object {
|
||||
private const val JS_LOG = "js-build.log"
|
||||
@@ -32,6 +33,8 @@ data class BuildLogFinder(
|
||||
private const val GRADLE_LOG = "gradle-build.log"
|
||||
private const val DATA_CONTAINER_LOG = "data-container-version-build.log"
|
||||
const val JS_JPS_LOG = "js-jps-build.log"
|
||||
private const val FIR_LOG = "fir-build.log"
|
||||
private const val GRADLE_FIR_LOG = "gradle-fir-build.log"
|
||||
private const val SIMPLE_LOG = "build.log"
|
||||
|
||||
fun isJpsLogFile(file: File): Boolean =
|
||||
@@ -45,6 +48,8 @@ data class BuildLogFinder(
|
||||
isScopeExpansionEnabled && SCOPE_EXPANDING_LOG in files -> SCOPE_EXPANDING_LOG
|
||||
isKlibEnabled && KLIB_LOG in files -> KLIB_LOG
|
||||
isJsEnabled && JS_LOG in files -> JS_LOG
|
||||
isGradleEnabled && isFirEnabled && GRADLE_FIR_LOG in files -> GRADLE_FIR_LOG
|
||||
isFirEnabled && FIR_LOG in files -> FIR_LOG
|
||||
isGradleEnabled && GRADLE_LOG in files -> GRADLE_LOG
|
||||
isJsEnabled && JS_JPS_LOG in files -> JS_JPS_LOG
|
||||
isDataContainerBuildLogEnabled && DATA_CONTAINER_LOG in files -> DATA_CONTAINER_LOG
|
||||
|
||||
@@ -10347,6 +10347,37 @@ public final class DebugProtoBuf {
|
||||
*/
|
||||
int getSealedSubclassFqName(int index);
|
||||
|
||||
/**
|
||||
* <code>optional int32 inline_class_underlying_property_name = 17;</code>
|
||||
*/
|
||||
boolean hasInlineClassUnderlyingPropertyName();
|
||||
/**
|
||||
* <code>optional int32 inline_class_underlying_property_name = 17;</code>
|
||||
*/
|
||||
int getInlineClassUnderlyingPropertyName();
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
|
||||
*/
|
||||
boolean hasInlineClassUnderlyingType();
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
|
||||
*/
|
||||
org.jetbrains.kotlin.metadata.DebugProtoBuf.Type getInlineClassUnderlyingType();
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
|
||||
*/
|
||||
org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder getInlineClassUnderlyingTypeOrBuilder();
|
||||
|
||||
/**
|
||||
* <code>optional int32 inline_class_underlying_type_id = 19;</code>
|
||||
*/
|
||||
boolean hasInlineClassUnderlyingTypeId();
|
||||
/**
|
||||
* <code>optional int32 inline_class_underlying_type_id = 19;</code>
|
||||
*/
|
||||
int getInlineClassUnderlyingTypeId();
|
||||
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30;</code>
|
||||
*/
|
||||
@@ -10585,9 +10616,32 @@ public final class DebugProtoBuf {
|
||||
input.popLimit(limit);
|
||||
break;
|
||||
}
|
||||
case 136: {
|
||||
bitField0_ |= 0x00000008;
|
||||
inlineClassUnderlyingPropertyName_ = input.readInt32();
|
||||
break;
|
||||
}
|
||||
case 146: {
|
||||
org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder subBuilder = null;
|
||||
if (((bitField0_ & 0x00000010) == 0x00000010)) {
|
||||
subBuilder = inlineClassUnderlyingType_.toBuilder();
|
||||
}
|
||||
inlineClassUnderlyingType_ = input.readMessage(org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.PARSER, extensionRegistry);
|
||||
if (subBuilder != null) {
|
||||
subBuilder.mergeFrom(inlineClassUnderlyingType_);
|
||||
inlineClassUnderlyingType_ = subBuilder.buildPartial();
|
||||
}
|
||||
bitField0_ |= 0x00000010;
|
||||
break;
|
||||
}
|
||||
case 152: {
|
||||
bitField0_ |= 0x00000020;
|
||||
inlineClassUnderlyingTypeId_ = input.readInt32();
|
||||
break;
|
||||
}
|
||||
case 242: {
|
||||
org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.Builder subBuilder = null;
|
||||
if (((bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
if (((bitField0_ & 0x00000040) == 0x00000040)) {
|
||||
subBuilder = typeTable_.toBuilder();
|
||||
}
|
||||
typeTable_ = input.readMessage(org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.PARSER, extensionRegistry);
|
||||
@@ -10595,13 +10649,13 @@ public final class DebugProtoBuf {
|
||||
subBuilder.mergeFrom(typeTable_);
|
||||
typeTable_ = subBuilder.buildPartial();
|
||||
}
|
||||
bitField0_ |= 0x00000008;
|
||||
bitField0_ |= 0x00000040;
|
||||
break;
|
||||
}
|
||||
case 248: {
|
||||
if (!((mutable_bitField0_ & 0x00004000) == 0x00004000)) {
|
||||
if (!((mutable_bitField0_ & 0x00020000) == 0x00020000)) {
|
||||
versionRequirement_ = new java.util.ArrayList<java.lang.Integer>();
|
||||
mutable_bitField0_ |= 0x00004000;
|
||||
mutable_bitField0_ |= 0x00020000;
|
||||
}
|
||||
versionRequirement_.add(input.readInt32());
|
||||
break;
|
||||
@@ -10609,9 +10663,9 @@ public final class DebugProtoBuf {
|
||||
case 250: {
|
||||
int length = input.readRawVarint32();
|
||||
int limit = input.pushLimit(length);
|
||||
if (!((mutable_bitField0_ & 0x00004000) == 0x00004000) && input.getBytesUntilLimit() > 0) {
|
||||
if (!((mutable_bitField0_ & 0x00020000) == 0x00020000) && input.getBytesUntilLimit() > 0) {
|
||||
versionRequirement_ = new java.util.ArrayList<java.lang.Integer>();
|
||||
mutable_bitField0_ |= 0x00004000;
|
||||
mutable_bitField0_ |= 0x00020000;
|
||||
}
|
||||
while (input.getBytesUntilLimit() > 0) {
|
||||
versionRequirement_.add(input.readInt32());
|
||||
@@ -10621,7 +10675,7 @@ public final class DebugProtoBuf {
|
||||
}
|
||||
case 258: {
|
||||
org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable.Builder subBuilder = null;
|
||||
if (((bitField0_ & 0x00000010) == 0x00000010)) {
|
||||
if (((bitField0_ & 0x00000080) == 0x00000080)) {
|
||||
subBuilder = versionRequirementTable_.toBuilder();
|
||||
}
|
||||
versionRequirementTable_ = input.readMessage(org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable.PARSER, extensionRegistry);
|
||||
@@ -10629,7 +10683,7 @@ public final class DebugProtoBuf {
|
||||
subBuilder.mergeFrom(versionRequirementTable_);
|
||||
versionRequirementTable_ = subBuilder.buildPartial();
|
||||
}
|
||||
bitField0_ |= 0x00000010;
|
||||
bitField0_ |= 0x00000080;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -10670,7 +10724,7 @@ public final class DebugProtoBuf {
|
||||
if (((mutable_bitField0_ & 0x00001000) == 0x00001000)) {
|
||||
sealedSubclassFqName_ = java.util.Collections.unmodifiableList(sealedSubclassFqName_);
|
||||
}
|
||||
if (((mutable_bitField0_ & 0x00004000) == 0x00004000)) {
|
||||
if (((mutable_bitField0_ & 0x00020000) == 0x00020000)) {
|
||||
versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_);
|
||||
}
|
||||
this.unknownFields = unknownFields.build();
|
||||
@@ -11225,13 +11279,64 @@ public final class DebugProtoBuf {
|
||||
}
|
||||
private int sealedSubclassFqNameMemoizedSerializedSize = -1;
|
||||
|
||||
public static final int INLINE_CLASS_UNDERLYING_PROPERTY_NAME_FIELD_NUMBER = 17;
|
||||
private int inlineClassUnderlyingPropertyName_;
|
||||
/**
|
||||
* <code>optional int32 inline_class_underlying_property_name = 17;</code>
|
||||
*/
|
||||
public boolean hasInlineClassUnderlyingPropertyName() {
|
||||
return ((bitField0_ & 0x00000008) == 0x00000008);
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 inline_class_underlying_property_name = 17;</code>
|
||||
*/
|
||||
public int getInlineClassUnderlyingPropertyName() {
|
||||
return inlineClassUnderlyingPropertyName_;
|
||||
}
|
||||
|
||||
public static final int INLINE_CLASS_UNDERLYING_TYPE_FIELD_NUMBER = 18;
|
||||
private org.jetbrains.kotlin.metadata.DebugProtoBuf.Type inlineClassUnderlyingType_;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
|
||||
*/
|
||||
public boolean hasInlineClassUnderlyingType() {
|
||||
return ((bitField0_ & 0x00000010) == 0x00000010);
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.metadata.DebugProtoBuf.Type getInlineClassUnderlyingType() {
|
||||
return inlineClassUnderlyingType_;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder getInlineClassUnderlyingTypeOrBuilder() {
|
||||
return inlineClassUnderlyingType_;
|
||||
}
|
||||
|
||||
public static final int INLINE_CLASS_UNDERLYING_TYPE_ID_FIELD_NUMBER = 19;
|
||||
private int inlineClassUnderlyingTypeId_;
|
||||
/**
|
||||
* <code>optional int32 inline_class_underlying_type_id = 19;</code>
|
||||
*/
|
||||
public boolean hasInlineClassUnderlyingTypeId() {
|
||||
return ((bitField0_ & 0x00000020) == 0x00000020);
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 inline_class_underlying_type_id = 19;</code>
|
||||
*/
|
||||
public int getInlineClassUnderlyingTypeId() {
|
||||
return inlineClassUnderlyingTypeId_;
|
||||
}
|
||||
|
||||
public static final int TYPE_TABLE_FIELD_NUMBER = 30;
|
||||
private org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable typeTable_;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30;</code>
|
||||
*/
|
||||
public boolean hasTypeTable() {
|
||||
return ((bitField0_ & 0x00000008) == 0x00000008);
|
||||
return ((bitField0_ & 0x00000040) == 0x00000040);
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30;</code>
|
||||
@@ -11286,7 +11391,7 @@ public final class DebugProtoBuf {
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.VersionRequirementTable version_requirement_table = 32;</code>
|
||||
*/
|
||||
public boolean hasVersionRequirementTable() {
|
||||
return ((bitField0_ & 0x00000010) == 0x00000010);
|
||||
return ((bitField0_ & 0x00000080) == 0x00000080);
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.VersionRequirementTable version_requirement_table = 32;</code>
|
||||
@@ -11315,6 +11420,9 @@ public final class DebugProtoBuf {
|
||||
typeAlias_ = java.util.Collections.emptyList();
|
||||
enumEntry_ = java.util.Collections.emptyList();
|
||||
sealedSubclassFqName_ = java.util.Collections.emptyList();
|
||||
inlineClassUnderlyingPropertyName_ = 0;
|
||||
inlineClassUnderlyingType_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.getDefaultInstance();
|
||||
inlineClassUnderlyingTypeId_ = 0;
|
||||
typeTable_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.getDefaultInstance();
|
||||
versionRequirement_ = java.util.Collections.emptyList();
|
||||
versionRequirementTable_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable.getDefaultInstance();
|
||||
@@ -11371,6 +11479,12 @@ public final class DebugProtoBuf {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasInlineClassUnderlyingType()) {
|
||||
if (!getInlineClassUnderlyingType().isInitialized()) {
|
||||
memoizedIsInitialized = 0;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasTypeTable()) {
|
||||
if (!getTypeTable().isInitialized()) {
|
||||
memoizedIsInitialized = 0;
|
||||
@@ -11443,12 +11557,21 @@ public final class DebugProtoBuf {
|
||||
output.writeInt32NoTag(sealedSubclassFqName_.get(i));
|
||||
}
|
||||
if (((bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
output.writeInt32(17, inlineClassUnderlyingPropertyName_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000010) == 0x00000010)) {
|
||||
output.writeMessage(18, inlineClassUnderlyingType_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000020) == 0x00000020)) {
|
||||
output.writeInt32(19, inlineClassUnderlyingTypeId_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000040) == 0x00000040)) {
|
||||
output.writeMessage(30, typeTable_);
|
||||
}
|
||||
for (int i = 0; i < versionRequirement_.size(); i++) {
|
||||
output.writeInt32(31, versionRequirement_.get(i));
|
||||
}
|
||||
if (((bitField0_ & 0x00000010) == 0x00000010)) {
|
||||
if (((bitField0_ & 0x00000080) == 0x00000080)) {
|
||||
output.writeMessage(32, versionRequirementTable_);
|
||||
}
|
||||
extensionWriter.writeUntil(19000, output);
|
||||
@@ -11544,6 +11667,18 @@ public final class DebugProtoBuf {
|
||||
sealedSubclassFqNameMemoizedSerializedSize = dataSize;
|
||||
}
|
||||
if (((bitField0_ & 0x00000008) == 0x00000008)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeInt32Size(17, inlineClassUnderlyingPropertyName_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000010) == 0x00000010)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(18, inlineClassUnderlyingType_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000020) == 0x00000020)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeInt32Size(19, inlineClassUnderlyingTypeId_);
|
||||
}
|
||||
if (((bitField0_ & 0x00000040) == 0x00000040)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(30, typeTable_);
|
||||
}
|
||||
@@ -11556,7 +11691,7 @@ public final class DebugProtoBuf {
|
||||
size += dataSize;
|
||||
size += 2 * getVersionRequirementList().size();
|
||||
}
|
||||
if (((bitField0_ & 0x00000010) == 0x00000010)) {
|
||||
if (((bitField0_ & 0x00000080) == 0x00000080)) {
|
||||
size += org.jetbrains.kotlin.protobuf.CodedOutputStream
|
||||
.computeMessageSize(32, versionRequirementTable_);
|
||||
}
|
||||
@@ -11678,6 +11813,7 @@ public final class DebugProtoBuf {
|
||||
getPropertyFieldBuilder();
|
||||
getTypeAliasFieldBuilder();
|
||||
getEnumEntryFieldBuilder();
|
||||
getInlineClassUnderlyingTypeFieldBuilder();
|
||||
getTypeTableFieldBuilder();
|
||||
getVersionRequirementTableFieldBuilder();
|
||||
}
|
||||
@@ -11742,20 +11878,30 @@ public final class DebugProtoBuf {
|
||||
}
|
||||
sealedSubclassFqName_ = java.util.Collections.emptyList();
|
||||
bitField0_ = (bitField0_ & ~0x00001000);
|
||||
inlineClassUnderlyingPropertyName_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00002000);
|
||||
if (inlineClassUnderlyingTypeBuilder_ == null) {
|
||||
inlineClassUnderlyingType_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.getDefaultInstance();
|
||||
} else {
|
||||
inlineClassUnderlyingTypeBuilder_.clear();
|
||||
}
|
||||
bitField0_ = (bitField0_ & ~0x00004000);
|
||||
inlineClassUnderlyingTypeId_ = 0;
|
||||
bitField0_ = (bitField0_ & ~0x00008000);
|
||||
if (typeTableBuilder_ == null) {
|
||||
typeTable_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.getDefaultInstance();
|
||||
} else {
|
||||
typeTableBuilder_.clear();
|
||||
}
|
||||
bitField0_ = (bitField0_ & ~0x00002000);
|
||||
bitField0_ = (bitField0_ & ~0x00010000);
|
||||
versionRequirement_ = java.util.Collections.emptyList();
|
||||
bitField0_ = (bitField0_ & ~0x00004000);
|
||||
bitField0_ = (bitField0_ & ~0x00020000);
|
||||
if (versionRequirementTableBuilder_ == null) {
|
||||
versionRequirementTable_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable.getDefaultInstance();
|
||||
} else {
|
||||
versionRequirementTableBuilder_.clear();
|
||||
}
|
||||
bitField0_ = (bitField0_ & ~0x00008000);
|
||||
bitField0_ = (bitField0_ & ~0x00040000);
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -11877,18 +12023,34 @@ public final class DebugProtoBuf {
|
||||
if (((from_bitField0_ & 0x00002000) == 0x00002000)) {
|
||||
to_bitField0_ |= 0x00000008;
|
||||
}
|
||||
result.inlineClassUnderlyingPropertyName_ = inlineClassUnderlyingPropertyName_;
|
||||
if (((from_bitField0_ & 0x00004000) == 0x00004000)) {
|
||||
to_bitField0_ |= 0x00000010;
|
||||
}
|
||||
if (inlineClassUnderlyingTypeBuilder_ == null) {
|
||||
result.inlineClassUnderlyingType_ = inlineClassUnderlyingType_;
|
||||
} else {
|
||||
result.inlineClassUnderlyingType_ = inlineClassUnderlyingTypeBuilder_.build();
|
||||
}
|
||||
if (((from_bitField0_ & 0x00008000) == 0x00008000)) {
|
||||
to_bitField0_ |= 0x00000020;
|
||||
}
|
||||
result.inlineClassUnderlyingTypeId_ = inlineClassUnderlyingTypeId_;
|
||||
if (((from_bitField0_ & 0x00010000) == 0x00010000)) {
|
||||
to_bitField0_ |= 0x00000040;
|
||||
}
|
||||
if (typeTableBuilder_ == null) {
|
||||
result.typeTable_ = typeTable_;
|
||||
} else {
|
||||
result.typeTable_ = typeTableBuilder_.build();
|
||||
}
|
||||
if (((bitField0_ & 0x00004000) == 0x00004000)) {
|
||||
if (((bitField0_ & 0x00020000) == 0x00020000)) {
|
||||
versionRequirement_ = java.util.Collections.unmodifiableList(versionRequirement_);
|
||||
bitField0_ = (bitField0_ & ~0x00004000);
|
||||
bitField0_ = (bitField0_ & ~0x00020000);
|
||||
}
|
||||
result.versionRequirement_ = versionRequirement_;
|
||||
if (((from_bitField0_ & 0x00008000) == 0x00008000)) {
|
||||
to_bitField0_ |= 0x00000010;
|
||||
if (((from_bitField0_ & 0x00040000) == 0x00040000)) {
|
||||
to_bitField0_ |= 0x00000080;
|
||||
}
|
||||
if (versionRequirementTableBuilder_ == null) {
|
||||
result.versionRequirementTable_ = versionRequirementTable_;
|
||||
@@ -12132,13 +12294,22 @@ public final class DebugProtoBuf {
|
||||
}
|
||||
onChanged();
|
||||
}
|
||||
if (other.hasInlineClassUnderlyingPropertyName()) {
|
||||
setInlineClassUnderlyingPropertyName(other.getInlineClassUnderlyingPropertyName());
|
||||
}
|
||||
if (other.hasInlineClassUnderlyingType()) {
|
||||
mergeInlineClassUnderlyingType(other.getInlineClassUnderlyingType());
|
||||
}
|
||||
if (other.hasInlineClassUnderlyingTypeId()) {
|
||||
setInlineClassUnderlyingTypeId(other.getInlineClassUnderlyingTypeId());
|
||||
}
|
||||
if (other.hasTypeTable()) {
|
||||
mergeTypeTable(other.getTypeTable());
|
||||
}
|
||||
if (!other.versionRequirement_.isEmpty()) {
|
||||
if (versionRequirement_.isEmpty()) {
|
||||
versionRequirement_ = other.versionRequirement_;
|
||||
bitField0_ = (bitField0_ & ~0x00004000);
|
||||
bitField0_ = (bitField0_ & ~0x00020000);
|
||||
} else {
|
||||
ensureVersionRequirementIsMutable();
|
||||
versionRequirement_.addAll(other.versionRequirement_);
|
||||
@@ -12200,6 +12371,12 @@ public final class DebugProtoBuf {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasInlineClassUnderlyingType()) {
|
||||
if (!getInlineClassUnderlyingType().isInitialized()) {
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (hasTypeTable()) {
|
||||
if (!getTypeTable().isInitialized()) {
|
||||
|
||||
@@ -14258,6 +14435,186 @@ public final class DebugProtoBuf {
|
||||
return this;
|
||||
}
|
||||
|
||||
private int inlineClassUnderlyingPropertyName_ ;
|
||||
/**
|
||||
* <code>optional int32 inline_class_underlying_property_name = 17;</code>
|
||||
*/
|
||||
public boolean hasInlineClassUnderlyingPropertyName() {
|
||||
return ((bitField0_ & 0x00002000) == 0x00002000);
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 inline_class_underlying_property_name = 17;</code>
|
||||
*/
|
||||
public int getInlineClassUnderlyingPropertyName() {
|
||||
return inlineClassUnderlyingPropertyName_;
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 inline_class_underlying_property_name = 17;</code>
|
||||
*/
|
||||
public Builder setInlineClassUnderlyingPropertyName(int value) {
|
||||
bitField0_ |= 0x00002000;
|
||||
inlineClassUnderlyingPropertyName_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 inline_class_underlying_property_name = 17;</code>
|
||||
*/
|
||||
public Builder clearInlineClassUnderlyingPropertyName() {
|
||||
bitField0_ = (bitField0_ & ~0x00002000);
|
||||
inlineClassUnderlyingPropertyName_ = 0;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
private org.jetbrains.kotlin.metadata.DebugProtoBuf.Type inlineClassUnderlyingType_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.getDefaultInstance();
|
||||
private org.jetbrains.kotlin.protobuf.SingleFieldBuilder<
|
||||
org.jetbrains.kotlin.metadata.DebugProtoBuf.Type, org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder, org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder> inlineClassUnderlyingTypeBuilder_;
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
|
||||
*/
|
||||
public boolean hasInlineClassUnderlyingType() {
|
||||
return ((bitField0_ & 0x00004000) == 0x00004000);
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.metadata.DebugProtoBuf.Type getInlineClassUnderlyingType() {
|
||||
if (inlineClassUnderlyingTypeBuilder_ == null) {
|
||||
return inlineClassUnderlyingType_;
|
||||
} else {
|
||||
return inlineClassUnderlyingTypeBuilder_.getMessage();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
|
||||
*/
|
||||
public Builder setInlineClassUnderlyingType(org.jetbrains.kotlin.metadata.DebugProtoBuf.Type value) {
|
||||
if (inlineClassUnderlyingTypeBuilder_ == null) {
|
||||
if (value == null) {
|
||||
throw new NullPointerException();
|
||||
}
|
||||
inlineClassUnderlyingType_ = value;
|
||||
onChanged();
|
||||
} else {
|
||||
inlineClassUnderlyingTypeBuilder_.setMessage(value);
|
||||
}
|
||||
bitField0_ |= 0x00004000;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
|
||||
*/
|
||||
public Builder setInlineClassUnderlyingType(
|
||||
org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder builderForValue) {
|
||||
if (inlineClassUnderlyingTypeBuilder_ == null) {
|
||||
inlineClassUnderlyingType_ = builderForValue.build();
|
||||
onChanged();
|
||||
} else {
|
||||
inlineClassUnderlyingTypeBuilder_.setMessage(builderForValue.build());
|
||||
}
|
||||
bitField0_ |= 0x00004000;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
|
||||
*/
|
||||
public Builder mergeInlineClassUnderlyingType(org.jetbrains.kotlin.metadata.DebugProtoBuf.Type value) {
|
||||
if (inlineClassUnderlyingTypeBuilder_ == null) {
|
||||
if (((bitField0_ & 0x00004000) == 0x00004000) &&
|
||||
inlineClassUnderlyingType_ != org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.getDefaultInstance()) {
|
||||
inlineClassUnderlyingType_ =
|
||||
org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.newBuilder(inlineClassUnderlyingType_).mergeFrom(value).buildPartial();
|
||||
} else {
|
||||
inlineClassUnderlyingType_ = value;
|
||||
}
|
||||
onChanged();
|
||||
} else {
|
||||
inlineClassUnderlyingTypeBuilder_.mergeFrom(value);
|
||||
}
|
||||
bitField0_ |= 0x00004000;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
|
||||
*/
|
||||
public Builder clearInlineClassUnderlyingType() {
|
||||
if (inlineClassUnderlyingTypeBuilder_ == null) {
|
||||
inlineClassUnderlyingType_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.getDefaultInstance();
|
||||
onChanged();
|
||||
} else {
|
||||
inlineClassUnderlyingTypeBuilder_.clear();
|
||||
}
|
||||
bitField0_ = (bitField0_ & ~0x00004000);
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder getInlineClassUnderlyingTypeBuilder() {
|
||||
bitField0_ |= 0x00004000;
|
||||
onChanged();
|
||||
return getInlineClassUnderlyingTypeFieldBuilder().getBuilder();
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder getInlineClassUnderlyingTypeOrBuilder() {
|
||||
if (inlineClassUnderlyingTypeBuilder_ != null) {
|
||||
return inlineClassUnderlyingTypeBuilder_.getMessageOrBuilder();
|
||||
} else {
|
||||
return inlineClassUnderlyingType_;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.Type inline_class_underlying_type = 18;</code>
|
||||
*/
|
||||
private org.jetbrains.kotlin.protobuf.SingleFieldBuilder<
|
||||
org.jetbrains.kotlin.metadata.DebugProtoBuf.Type, org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder, org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder>
|
||||
getInlineClassUnderlyingTypeFieldBuilder() {
|
||||
if (inlineClassUnderlyingTypeBuilder_ == null) {
|
||||
inlineClassUnderlyingTypeBuilder_ = new org.jetbrains.kotlin.protobuf.SingleFieldBuilder<
|
||||
org.jetbrains.kotlin.metadata.DebugProtoBuf.Type, org.jetbrains.kotlin.metadata.DebugProtoBuf.Type.Builder, org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeOrBuilder>(
|
||||
getInlineClassUnderlyingType(),
|
||||
getParentForChildren(),
|
||||
isClean());
|
||||
inlineClassUnderlyingType_ = null;
|
||||
}
|
||||
return inlineClassUnderlyingTypeBuilder_;
|
||||
}
|
||||
|
||||
private int inlineClassUnderlyingTypeId_ ;
|
||||
/**
|
||||
* <code>optional int32 inline_class_underlying_type_id = 19;</code>
|
||||
*/
|
||||
public boolean hasInlineClassUnderlyingTypeId() {
|
||||
return ((bitField0_ & 0x00008000) == 0x00008000);
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 inline_class_underlying_type_id = 19;</code>
|
||||
*/
|
||||
public int getInlineClassUnderlyingTypeId() {
|
||||
return inlineClassUnderlyingTypeId_;
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 inline_class_underlying_type_id = 19;</code>
|
||||
*/
|
||||
public Builder setInlineClassUnderlyingTypeId(int value) {
|
||||
bitField0_ |= 0x00008000;
|
||||
inlineClassUnderlyingTypeId_ = value;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional int32 inline_class_underlying_type_id = 19;</code>
|
||||
*/
|
||||
public Builder clearInlineClassUnderlyingTypeId() {
|
||||
bitField0_ = (bitField0_ & ~0x00008000);
|
||||
inlineClassUnderlyingTypeId_ = 0;
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
private org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable typeTable_ = org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.getDefaultInstance();
|
||||
private org.jetbrains.kotlin.protobuf.SingleFieldBuilder<
|
||||
org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable, org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.Builder, org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTableOrBuilder> typeTableBuilder_;
|
||||
@@ -14265,7 +14622,7 @@ public final class DebugProtoBuf {
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30;</code>
|
||||
*/
|
||||
public boolean hasTypeTable() {
|
||||
return ((bitField0_ & 0x00002000) == 0x00002000);
|
||||
return ((bitField0_ & 0x00010000) == 0x00010000);
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30;</code>
|
||||
@@ -14290,7 +14647,7 @@ public final class DebugProtoBuf {
|
||||
} else {
|
||||
typeTableBuilder_.setMessage(value);
|
||||
}
|
||||
bitField0_ |= 0x00002000;
|
||||
bitField0_ |= 0x00010000;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
@@ -14304,7 +14661,7 @@ public final class DebugProtoBuf {
|
||||
} else {
|
||||
typeTableBuilder_.setMessage(builderForValue.build());
|
||||
}
|
||||
bitField0_ |= 0x00002000;
|
||||
bitField0_ |= 0x00010000;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
@@ -14312,7 +14669,7 @@ public final class DebugProtoBuf {
|
||||
*/
|
||||
public Builder mergeTypeTable(org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable value) {
|
||||
if (typeTableBuilder_ == null) {
|
||||
if (((bitField0_ & 0x00002000) == 0x00002000) &&
|
||||
if (((bitField0_ & 0x00010000) == 0x00010000) &&
|
||||
typeTable_ != org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.getDefaultInstance()) {
|
||||
typeTable_ =
|
||||
org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.newBuilder(typeTable_).mergeFrom(value).buildPartial();
|
||||
@@ -14323,7 +14680,7 @@ public final class DebugProtoBuf {
|
||||
} else {
|
||||
typeTableBuilder_.mergeFrom(value);
|
||||
}
|
||||
bitField0_ |= 0x00002000;
|
||||
bitField0_ |= 0x00010000;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
@@ -14336,14 +14693,14 @@ public final class DebugProtoBuf {
|
||||
} else {
|
||||
typeTableBuilder_.clear();
|
||||
}
|
||||
bitField0_ = (bitField0_ & ~0x00002000);
|
||||
bitField0_ = (bitField0_ & ~0x00010000);
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.TypeTable type_table = 30;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.metadata.DebugProtoBuf.TypeTable.Builder getTypeTableBuilder() {
|
||||
bitField0_ |= 0x00002000;
|
||||
bitField0_ |= 0x00010000;
|
||||
onChanged();
|
||||
return getTypeTableFieldBuilder().getBuilder();
|
||||
}
|
||||
@@ -14376,9 +14733,9 @@ public final class DebugProtoBuf {
|
||||
|
||||
private java.util.List<java.lang.Integer> versionRequirement_ = java.util.Collections.emptyList();
|
||||
private void ensureVersionRequirementIsMutable() {
|
||||
if (!((bitField0_ & 0x00004000) == 0x00004000)) {
|
||||
if (!((bitField0_ & 0x00020000) == 0x00020000)) {
|
||||
versionRequirement_ = new java.util.ArrayList<java.lang.Integer>(versionRequirement_);
|
||||
bitField0_ |= 0x00004000;
|
||||
bitField0_ |= 0x00020000;
|
||||
}
|
||||
}
|
||||
/**
|
||||
@@ -14463,7 +14820,7 @@ public final class DebugProtoBuf {
|
||||
*/
|
||||
public Builder clearVersionRequirement() {
|
||||
versionRequirement_ = java.util.Collections.emptyList();
|
||||
bitField0_ = (bitField0_ & ~0x00004000);
|
||||
bitField0_ = (bitField0_ & ~0x00020000);
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
@@ -14475,7 +14832,7 @@ public final class DebugProtoBuf {
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.VersionRequirementTable version_requirement_table = 32;</code>
|
||||
*/
|
||||
public boolean hasVersionRequirementTable() {
|
||||
return ((bitField0_ & 0x00008000) == 0x00008000);
|
||||
return ((bitField0_ & 0x00040000) == 0x00040000);
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.VersionRequirementTable version_requirement_table = 32;</code>
|
||||
@@ -14500,7 +14857,7 @@ public final class DebugProtoBuf {
|
||||
} else {
|
||||
versionRequirementTableBuilder_.setMessage(value);
|
||||
}
|
||||
bitField0_ |= 0x00008000;
|
||||
bitField0_ |= 0x00040000;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
@@ -14514,7 +14871,7 @@ public final class DebugProtoBuf {
|
||||
} else {
|
||||
versionRequirementTableBuilder_.setMessage(builderForValue.build());
|
||||
}
|
||||
bitField0_ |= 0x00008000;
|
||||
bitField0_ |= 0x00040000;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
@@ -14522,7 +14879,7 @@ public final class DebugProtoBuf {
|
||||
*/
|
||||
public Builder mergeVersionRequirementTable(org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable value) {
|
||||
if (versionRequirementTableBuilder_ == null) {
|
||||
if (((bitField0_ & 0x00008000) == 0x00008000) &&
|
||||
if (((bitField0_ & 0x00040000) == 0x00040000) &&
|
||||
versionRequirementTable_ != org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable.getDefaultInstance()) {
|
||||
versionRequirementTable_ =
|
||||
org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable.newBuilder(versionRequirementTable_).mergeFrom(value).buildPartial();
|
||||
@@ -14533,7 +14890,7 @@ public final class DebugProtoBuf {
|
||||
} else {
|
||||
versionRequirementTableBuilder_.mergeFrom(value);
|
||||
}
|
||||
bitField0_ |= 0x00008000;
|
||||
bitField0_ |= 0x00040000;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
@@ -14546,14 +14903,14 @@ public final class DebugProtoBuf {
|
||||
} else {
|
||||
versionRequirementTableBuilder_.clear();
|
||||
}
|
||||
bitField0_ = (bitField0_ & ~0x00008000);
|
||||
bitField0_ = (bitField0_ & ~0x00040000);
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <code>optional .org.jetbrains.kotlin.metadata.VersionRequirementTable version_requirement_table = 32;</code>
|
||||
*/
|
||||
public org.jetbrains.kotlin.metadata.DebugProtoBuf.VersionRequirementTable.Builder getVersionRequirementTableBuilder() {
|
||||
bitField0_ |= 0x00008000;
|
||||
bitField0_ |= 0x00040000;
|
||||
onChanged();
|
||||
return getVersionRequirementTableFieldBuilder().getBuilder();
|
||||
}
|
||||
@@ -34382,7 +34739,7 @@ public final class DebugProtoBuf {
|
||||
"Variance:\003INV\0228\n\013upper_bound\030\005 \003(\0132#.org" +
|
||||
".jetbrains.kotlin.metadata.Type\022\036\n\016upper" +
|
||||
"_bound_id\030\006 \003(\005B\006\020\001\240\265\030\001\"$\n\010Variance\022\006\n\002I" +
|
||||
"N\020\000\022\007\n\003OUT\020\001\022\007\n\003INV\020\002*\005\010d\020\350\007\"\250\007\n\005Class\022\020" +
|
||||
"N\020\000\022\007\n\003OUT\020\001\022\007\n\003INV\020\002*\005\010d\020\350\007\"\327\010\n\005Class\022\020" +
|
||||
"\n\005flags\030\001 \001(\005:\0016\022\025\n\007fq_name\030\003 \002(\005B\004\220\265\030\001\022",
|
||||
"#\n\025companion_object_name\030\004 \001(\005B\004\210\265\030\001\022D\n\016" +
|
||||
"type_parameter\030\005 \003(\0132,.org.jetbrains.kot" +
|
||||
@@ -34398,122 +34755,127 @@ public final class DebugProtoBuf {
|
||||
"brains.kotlin.metadata.TypeAlias\022<\n\nenum" +
|
||||
"_entry\030\r \003(\0132(.org.jetbrains.kotlin.meta" +
|
||||
"data.EnumEntry\022\'\n\027sealed_subclass_fq_nam" +
|
||||
"e\030\020 \003(\005B\006\020\001\220\265\030\001\022<\n\ntype_table\030\036 \001(\0132(.or" +
|
||||
"g.jetbrains.kotlin.metadata.TypeTable\022\033\n" +
|
||||
"\023version_requirement\030\037 \003(\005\022Y\n\031version_re" +
|
||||
"quirement_table\030 \001(\01326.org.jetbrains.ko" +
|
||||
"tlin.metadata.VersionRequirementTable\"x\n" +
|
||||
"\004Kind\022\t\n\005CLASS\020\000\022\r\n\tINTERFACE\020\001\022\016\n\nENUM_",
|
||||
"CLASS\020\002\022\016\n\nENUM_ENTRY\020\003\022\024\n\020ANNOTATION_CL" +
|
||||
"ASS\020\004\022\n\n\006OBJECT\020\005\022\024\n\020COMPANION_OBJECT\020\006*" +
|
||||
"\006\010d\020\270\224\001\"\335\002\n\007Package\0229\n\010function\030\003 \003(\0132\'." +
|
||||
"org.jetbrains.kotlin.metadata.Function\0229" +
|
||||
"\n\010property\030\004 \003(\0132\'.org.jetbrains.kotlin." +
|
||||
"metadata.Property\022<\n\ntype_alias\030\005 \003(\0132(." +
|
||||
"org.jetbrains.kotlin.metadata.TypeAlias\022" +
|
||||
"<\n\ntype_table\030\036 \001(\0132(.org.jetbrains.kotl" +
|
||||
"in.metadata.TypeTable\022Y\n\031version_require" +
|
||||
"ment_table\030 \001(\01326.org.jetbrains.kotlin.",
|
||||
"metadata.VersionRequirementTable*\005\010d\020\310\001\"" +
|
||||
"`\n\tTypeTable\0221\n\004type\030\001 \003(\0132#.org.jetbrai" +
|
||||
"ns.kotlin.metadata.Type\022\032\n\016first_nullabl" +
|
||||
"e\030\002 \001(\005:\002-1:\004\240\273\030\001\"\214\001\n\013Constructor\022\020\n\005fla" +
|
||||
"gs\030\001 \001(\005:\0016\022F\n\017value_parameter\030\002 \003(\0132-.o" +
|
||||
"rg.jetbrains.kotlin.metadata.ValueParame" +
|
||||
"ter\022\033\n\023version_requirement\030\037 \003(\005*\006\010d\020\270\224\001" +
|
||||
"\"\246\004\n\010Function\022\020\n\005flags\030\t \001(\005:\0016\022\024\n\told_f" +
|
||||
"lags\030\001 \001(\005:\0016\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\0228\n\013ret" +
|
||||
"urn_type\030\003 \001(\0132#.org.jetbrains.kotlin.me",
|
||||
"tadata.Type\022\034\n\016return_type_id\030\007 \001(\005B\004\240\265\030" +
|
||||
"\001\022D\n\016type_parameter\030\004 \003(\0132,.org.jetbrain" +
|
||||
"s.kotlin.metadata.TypeParameter\022:\n\rrecei" +
|
||||
"ver_type\030\005 \001(\0132#.org.jetbrains.kotlin.me" +
|
||||
"tadata.Type\022\036\n\020receiver_type_id\030\010 \001(\005B\004\240" +
|
||||
"\265\030\001\022F\n\017value_parameter\030\006 \003(\0132-.org.jetbr" +
|
||||
"ains.kotlin.metadata.ValueParameter\022<\n\nt" +
|
||||
"ype_table\030\036 \001(\0132(.org.jetbrains.kotlin.m" +
|
||||
"etadata.TypeTable\022\033\n\023version_requirement" +
|
||||
"\030\037 \003(\005\0229\n\010contract\030 \001(\0132\'.org.jetbrains",
|
||||
".kotlin.metadata.Contract*\006\010d\020\270\224\001\"\345\003\n\010Pr" +
|
||||
"operty\022\022\n\005flags\030\013 \001(\005:\003518\022\027\n\told_flags\030" +
|
||||
"\001 \001(\005:\0042054\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\0228\n\013retur" +
|
||||
"n_type\030\003 \001(\0132#.org.jetbrains.kotlin.meta" +
|
||||
"data.Type\022\034\n\016return_type_id\030\t \001(\005B\004\240\265\030\001\022" +
|
||||
"D\n\016type_parameter\030\004 \003(\0132,.org.jetbrains." +
|
||||
"kotlin.metadata.TypeParameter\022:\n\rreceive" +
|
||||
"r_type\030\005 \001(\0132#.org.jetbrains.kotlin.meta" +
|
||||
"data.Type\022\036\n\020receiver_type_id\030\n \001(\005B\004\240\265\030" +
|
||||
"\001\022M\n\026setter_value_parameter\030\006 \001(\0132-.org.",
|
||||
"jetbrains.kotlin.metadata.ValueParameter" +
|
||||
"\022\024\n\014getter_flags\030\007 \001(\005\022\024\n\014setter_flags\030\010" +
|
||||
" \001(\005\022\033\n\023version_requirement\030\037 \003(\005*\006\010d\020\270\224" +
|
||||
"\001\"\357\001\n\016ValueParameter\022\020\n\005flags\030\001 \001(\005:\0010\022\022" +
|
||||
"\n\004name\030\002 \002(\005B\004\210\265\030\001\0221\n\004type\030\003 \001(\0132#.org.j" +
|
||||
"etbrains.kotlin.metadata.Type\022\025\n\007type_id" +
|
||||
"\030\005 \001(\005B\004\240\265\030\001\022@\n\023vararg_element_type\030\004 \001(" +
|
||||
"\0132#.org.jetbrains.kotlin.metadata.Type\022$" +
|
||||
"\n\026vararg_element_type_id\030\006 \001(\005B\004\240\265\030\001*\005\010d" +
|
||||
"\020\310\001\"\226\003\n\tTypeAlias\022\020\n\005flags\030\001 \001(\005:\0016\022\022\n\004n",
|
||||
"ame\030\002 \002(\005B\004\210\265\030\001\022D\n\016type_parameter\030\003 \003(\0132" +
|
||||
",.org.jetbrains.kotlin.metadata.TypePara" +
|
||||
"meter\022<\n\017underlying_type\030\004 \001(\0132#.org.jet" +
|
||||
"brains.kotlin.metadata.Type\022 \n\022underlyin" +
|
||||
"g_type_id\030\005 \001(\005B\004\240\265\030\001\022:\n\rexpanded_type\030\006" +
|
||||
" \001(\0132#.org.jetbrains.kotlin.metadata.Typ" +
|
||||
"e\022\036\n\020expanded_type_id\030\007 \001(\005B\004\240\265\030\001\022=\n\nann" +
|
||||
"otation\030\010 \003(\0132).org.jetbrains.kotlin.met" +
|
||||
"adata.Annotation\022\033\n\023version_requirement\030" +
|
||||
"\037 \003(\005*\005\010d\020\310\001\"&\n\tEnumEntry\022\022\n\004name\030\001 \001(\005B",
|
||||
"\004\210\265\030\001*\005\010d\020\310\001\"\225\003\n\022VersionRequirement\022\017\n\007v" +
|
||||
"ersion\030\001 \001(\005\022\024\n\014version_full\030\002 \001(\005\022M\n\005le" +
|
||||
"vel\030\003 \001(\01627.org.jetbrains.kotlin.metadat" +
|
||||
"a.VersionRequirement.Level:\005ERROR\022\022\n\nerr" +
|
||||
"or_code\030\004 \001(\005\022\025\n\007message\030\005 \001(\005B\004\230\265\030\001\022e\n\014" +
|
||||
"version_kind\030\006 \001(\0162=.org.jetbrains.kotli" +
|
||||
"n.metadata.VersionRequirement.VersionKin" +
|
||||
"d:\020LANGUAGE_VERSION\"+\n\005Level\022\013\n\007WARNING\020" +
|
||||
"\000\022\t\n\005ERROR\020\001\022\n\n\006HIDDEN\020\002\"J\n\013VersionKind\022" +
|
||||
"\024\n\020LANGUAGE_VERSION\020\000\022\024\n\020COMPILER_VERSIO",
|
||||
"N\020\001\022\017\n\013API_VERSION\020\002\"a\n\027VersionRequireme" +
|
||||
"ntTable\022F\n\013requirement\030\001 \003(\01321.org.jetbr" +
|
||||
"ains.kotlin.metadata.VersionRequirement\"" +
|
||||
"\217\002\n\017PackageFragment\022;\n\007strings\030\001 \001(\0132*.o" +
|
||||
"rg.jetbrains.kotlin.metadata.StringTable" +
|
||||
"\022J\n\017qualified_names\030\002 \001(\01321.org.jetbrain" +
|
||||
"s.kotlin.metadata.QualifiedNameTable\0227\n\007" +
|
||||
"package\030\003 \001(\0132&.org.jetbrains.kotlin.met" +
|
||||
"adata.Package\0223\n\005class\030\004 \003(\0132$.org.jetbr" +
|
||||
"ains.kotlin.metadata.Class*\005\010d\020\310\001\"A\n\010Con",
|
||||
"tract\0225\n\006effect\030\001 \003(\0132%.org.jetbrains.ko" +
|
||||
"tlin.metadata.Effect\"\306\003\n\006Effect\022E\n\013effec" +
|
||||
"t_type\030\001 \001(\01620.org.jetbrains.kotlin.meta" +
|
||||
"data.Effect.EffectType\022N\n\033effect_constru" +
|
||||
"ctor_argument\030\002 \003(\0132).org.jetbrains.kotl" +
|
||||
"in.metadata.Expression\022S\n conclusion_of_" +
|
||||
"conditional_effect\030\003 \001(\0132).org.jetbrains" +
|
||||
".kotlin.metadata.Expression\022B\n\004kind\030\004 \001(" +
|
||||
"\01624.org.jetbrains.kotlin.metadata.Effect" +
|
||||
".InvocationKind\"C\n\nEffectType\022\024\n\020RETURNS",
|
||||
"_CONSTANT\020\000\022\t\n\005CALLS\020\001\022\024\n\020RETURNS_NOT_NU" +
|
||||
"LL\020\002\"G\n\016InvocationKind\022\020\n\014AT_MOST_ONCE\020\000" +
|
||||
"\022\020\n\014EXACTLY_ONCE\020\001\022\021\n\rAT_LEAST_ONCE\020\002\"\245\003" +
|
||||
"\n\nExpression\022\020\n\005flags\030\001 \001(\005:\0010\022!\n\031value_" +
|
||||
"parameter_reference\030\002 \001(\005\022O\n\016constant_va" +
|
||||
"lue\030\003 \001(\01627.org.jetbrains.kotlin.metadat" +
|
||||
"a.Expression.ConstantValue\022=\n\020is_instanc" +
|
||||
"e_type\030\004 \001(\0132#.org.jetbrains.kotlin.meta" +
|
||||
"data.Type\022!\n\023is_instance_type_id\030\005 \001(\005B\004" +
|
||||
"\240\265\030\001\022?\n\014and_argument\030\006 \003(\0132).org.jetbrai",
|
||||
"ns.kotlin.metadata.Expression\022>\n\013or_argu" +
|
||||
"ment\030\007 \003(\0132).org.jetbrains.kotlin.metada" +
|
||||
"ta.Expression\".\n\rConstantValue\022\010\n\004TRUE\020\000" +
|
||||
"\022\t\n\005FALSE\020\001\022\010\n\004NULL\020\002*9\n\010Modality\022\t\n\005FIN" +
|
||||
"AL\020\000\022\010\n\004OPEN\020\001\022\014\n\010ABSTRACT\020\002\022\n\n\006SEALED\020\003" +
|
||||
"*b\n\nVisibility\022\014\n\010INTERNAL\020\000\022\013\n\007PRIVATE\020" +
|
||||
"\001\022\r\n\tPROTECTED\020\002\022\n\n\006PUBLIC\020\003\022\023\n\017PRIVATE_" +
|
||||
"TO_THIS\020\004\022\t\n\005LOCAL\020\005*Q\n\nMemberKind\022\017\n\013DE" +
|
||||
"CLARATION\020\000\022\021\n\rFAKE_OVERRIDE\020\001\022\016\n\nDELEGA" +
|
||||
"TION\020\002\022\017\n\013SYNTHESIZED\020\003B\017B\rDebugProtoBuf"
|
||||
"e\030\020 \003(\005B\006\020\001\220\265\030\001\0223\n%inline_class_underlyi" +
|
||||
"ng_property_name\030\021 \001(\005B\004\210\265\030\001\022I\n\034inline_c" +
|
||||
"lass_underlying_type\030\022 \001(\0132#.org.jetbrai" +
|
||||
"ns.kotlin.metadata.Type\022-\n\037inline_class_" +
|
||||
"underlying_type_id\030\023 \001(\005B\004\240\265\030\001\022<\n\ntype_t" +
|
||||
"able\030\036 \001(\0132(.org.jetbrains.kotlin.metada",
|
||||
"ta.TypeTable\022\033\n\023version_requirement\030\037 \003(" +
|
||||
"\005\022Y\n\031version_requirement_table\030 \001(\01326.o" +
|
||||
"rg.jetbrains.kotlin.metadata.VersionRequ" +
|
||||
"irementTable\"x\n\004Kind\022\t\n\005CLASS\020\000\022\r\n\tINTER" +
|
||||
"FACE\020\001\022\016\n\nENUM_CLASS\020\002\022\016\n\nENUM_ENTRY\020\003\022\024" +
|
||||
"\n\020ANNOTATION_CLASS\020\004\022\n\n\006OBJECT\020\005\022\024\n\020COMP" +
|
||||
"ANION_OBJECT\020\006*\006\010d\020\270\224\001\"\335\002\n\007Package\0229\n\010fu" +
|
||||
"nction\030\003 \003(\0132\'.org.jetbrains.kotlin.meta" +
|
||||
"data.Function\0229\n\010property\030\004 \003(\0132\'.org.je" +
|
||||
"tbrains.kotlin.metadata.Property\022<\n\ntype",
|
||||
"_alias\030\005 \003(\0132(.org.jetbrains.kotlin.meta" +
|
||||
"data.TypeAlias\022<\n\ntype_table\030\036 \001(\0132(.org" +
|
||||
".jetbrains.kotlin.metadata.TypeTable\022Y\n\031" +
|
||||
"version_requirement_table\030 \001(\01326.org.je" +
|
||||
"tbrains.kotlin.metadata.VersionRequireme" +
|
||||
"ntTable*\005\010d\020\310\001\"`\n\tTypeTable\0221\n\004type\030\001 \003(" +
|
||||
"\0132#.org.jetbrains.kotlin.metadata.Type\022\032" +
|
||||
"\n\016first_nullable\030\002 \001(\005:\002-1:\004\240\273\030\001\"\214\001\n\013Con" +
|
||||
"structor\022\020\n\005flags\030\001 \001(\005:\0016\022F\n\017value_para" +
|
||||
"meter\030\002 \003(\0132-.org.jetbrains.kotlin.metad",
|
||||
"ata.ValueParameter\022\033\n\023version_requiremen" +
|
||||
"t\030\037 \003(\005*\006\010d\020\270\224\001\"\246\004\n\010Function\022\020\n\005flags\030\t " +
|
||||
"\001(\005:\0016\022\024\n\told_flags\030\001 \001(\005:\0016\022\022\n\004name\030\002 \002" +
|
||||
"(\005B\004\210\265\030\001\0228\n\013return_type\030\003 \001(\0132#.org.jetb" +
|
||||
"rains.kotlin.metadata.Type\022\034\n\016return_typ" +
|
||||
"e_id\030\007 \001(\005B\004\240\265\030\001\022D\n\016type_parameter\030\004 \003(\013" +
|
||||
"2,.org.jetbrains.kotlin.metadata.TypePar" +
|
||||
"ameter\022:\n\rreceiver_type\030\005 \001(\0132#.org.jetb" +
|
||||
"rains.kotlin.metadata.Type\022\036\n\020receiver_t" +
|
||||
"ype_id\030\010 \001(\005B\004\240\265\030\001\022F\n\017value_parameter\030\006 ",
|
||||
"\003(\0132-.org.jetbrains.kotlin.metadata.Valu" +
|
||||
"eParameter\022<\n\ntype_table\030\036 \001(\0132(.org.jet" +
|
||||
"brains.kotlin.metadata.TypeTable\022\033\n\023vers" +
|
||||
"ion_requirement\030\037 \003(\005\0229\n\010contract\030 \001(\0132" +
|
||||
"\'.org.jetbrains.kotlin.metadata.Contract" +
|
||||
"*\006\010d\020\270\224\001\"\345\003\n\010Property\022\022\n\005flags\030\013 \001(\005:\00351" +
|
||||
"8\022\027\n\told_flags\030\001 \001(\005:\0042054\022\022\n\004name\030\002 \002(\005" +
|
||||
"B\004\210\265\030\001\0228\n\013return_type\030\003 \001(\0132#.org.jetbra" +
|
||||
"ins.kotlin.metadata.Type\022\034\n\016return_type_" +
|
||||
"id\030\t \001(\005B\004\240\265\030\001\022D\n\016type_parameter\030\004 \003(\0132,",
|
||||
".org.jetbrains.kotlin.metadata.TypeParam" +
|
||||
"eter\022:\n\rreceiver_type\030\005 \001(\0132#.org.jetbra" +
|
||||
"ins.kotlin.metadata.Type\022\036\n\020receiver_typ" +
|
||||
"e_id\030\n \001(\005B\004\240\265\030\001\022M\n\026setter_value_paramet" +
|
||||
"er\030\006 \001(\0132-.org.jetbrains.kotlin.metadata" +
|
||||
".ValueParameter\022\024\n\014getter_flags\030\007 \001(\005\022\024\n" +
|
||||
"\014setter_flags\030\010 \001(\005\022\033\n\023version_requireme" +
|
||||
"nt\030\037 \003(\005*\006\010d\020\270\224\001\"\357\001\n\016ValueParameter\022\020\n\005f" +
|
||||
"lags\030\001 \001(\005:\0010\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\0221\n\004typ" +
|
||||
"e\030\003 \001(\0132#.org.jetbrains.kotlin.metadata.",
|
||||
"Type\022\025\n\007type_id\030\005 \001(\005B\004\240\265\030\001\022@\n\023vararg_el" +
|
||||
"ement_type\030\004 \001(\0132#.org.jetbrains.kotlin." +
|
||||
"metadata.Type\022$\n\026vararg_element_type_id\030" +
|
||||
"\006 \001(\005B\004\240\265\030\001*\005\010d\020\310\001\"\226\003\n\tTypeAlias\022\020\n\005flag" +
|
||||
"s\030\001 \001(\005:\0016\022\022\n\004name\030\002 \002(\005B\004\210\265\030\001\022D\n\016type_p" +
|
||||
"arameter\030\003 \003(\0132,.org.jetbrains.kotlin.me" +
|
||||
"tadata.TypeParameter\022<\n\017underlying_type\030" +
|
||||
"\004 \001(\0132#.org.jetbrains.kotlin.metadata.Ty" +
|
||||
"pe\022 \n\022underlying_type_id\030\005 \001(\005B\004\240\265\030\001\022:\n\r" +
|
||||
"expanded_type\030\006 \001(\0132#.org.jetbrains.kotl",
|
||||
"in.metadata.Type\022\036\n\020expanded_type_id\030\007 \001" +
|
||||
"(\005B\004\240\265\030\001\022=\n\nannotation\030\010 \003(\0132).org.jetbr" +
|
||||
"ains.kotlin.metadata.Annotation\022\033\n\023versi" +
|
||||
"on_requirement\030\037 \003(\005*\005\010d\020\310\001\"&\n\tEnumEntry" +
|
||||
"\022\022\n\004name\030\001 \001(\005B\004\210\265\030\001*\005\010d\020\310\001\"\225\003\n\022VersionR" +
|
||||
"equirement\022\017\n\007version\030\001 \001(\005\022\024\n\014version_f" +
|
||||
"ull\030\002 \001(\005\022M\n\005level\030\003 \001(\01627.org.jetbrains" +
|
||||
".kotlin.metadata.VersionRequirement.Leve" +
|
||||
"l:\005ERROR\022\022\n\nerror_code\030\004 \001(\005\022\025\n\007message\030" +
|
||||
"\005 \001(\005B\004\230\265\030\001\022e\n\014version_kind\030\006 \001(\0162=.org.",
|
||||
"jetbrains.kotlin.metadata.VersionRequire" +
|
||||
"ment.VersionKind:\020LANGUAGE_VERSION\"+\n\005Le" +
|
||||
"vel\022\013\n\007WARNING\020\000\022\t\n\005ERROR\020\001\022\n\n\006HIDDEN\020\002\"" +
|
||||
"J\n\013VersionKind\022\024\n\020LANGUAGE_VERSION\020\000\022\024\n\020" +
|
||||
"COMPILER_VERSION\020\001\022\017\n\013API_VERSION\020\002\"a\n\027V" +
|
||||
"ersionRequirementTable\022F\n\013requirement\030\001 " +
|
||||
"\003(\01321.org.jetbrains.kotlin.metadata.Vers" +
|
||||
"ionRequirement\"\217\002\n\017PackageFragment\022;\n\007st" +
|
||||
"rings\030\001 \001(\0132*.org.jetbrains.kotlin.metad" +
|
||||
"ata.StringTable\022J\n\017qualified_names\030\002 \001(\013",
|
||||
"21.org.jetbrains.kotlin.metadata.Qualifi" +
|
||||
"edNameTable\0227\n\007package\030\003 \001(\0132&.org.jetbr" +
|
||||
"ains.kotlin.metadata.Package\0223\n\005class\030\004 " +
|
||||
"\003(\0132$.org.jetbrains.kotlin.metadata.Clas" +
|
||||
"s*\005\010d\020\310\001\"A\n\010Contract\0225\n\006effect\030\001 \003(\0132%.o" +
|
||||
"rg.jetbrains.kotlin.metadata.Effect\"\306\003\n\006" +
|
||||
"Effect\022E\n\013effect_type\030\001 \001(\01620.org.jetbra" +
|
||||
"ins.kotlin.metadata.Effect.EffectType\022N\n" +
|
||||
"\033effect_constructor_argument\030\002 \003(\0132).org" +
|
||||
".jetbrains.kotlin.metadata.Expression\022S\n",
|
||||
" conclusion_of_conditional_effect\030\003 \001(\0132" +
|
||||
").org.jetbrains.kotlin.metadata.Expressi" +
|
||||
"on\022B\n\004kind\030\004 \001(\01624.org.jetbrains.kotlin." +
|
||||
"metadata.Effect.InvocationKind\"C\n\nEffect" +
|
||||
"Type\022\024\n\020RETURNS_CONSTANT\020\000\022\t\n\005CALLS\020\001\022\024\n" +
|
||||
"\020RETURNS_NOT_NULL\020\002\"G\n\016InvocationKind\022\020\n" +
|
||||
"\014AT_MOST_ONCE\020\000\022\020\n\014EXACTLY_ONCE\020\001\022\021\n\rAT_" +
|
||||
"LEAST_ONCE\020\002\"\245\003\n\nExpression\022\020\n\005flags\030\001 \001" +
|
||||
"(\005:\0010\022!\n\031value_parameter_reference\030\002 \001(\005" +
|
||||
"\022O\n\016constant_value\030\003 \001(\01627.org.jetbrains",
|
||||
".kotlin.metadata.Expression.ConstantValu" +
|
||||
"e\022=\n\020is_instance_type\030\004 \001(\0132#.org.jetbra" +
|
||||
"ins.kotlin.metadata.Type\022!\n\023is_instance_" +
|
||||
"type_id\030\005 \001(\005B\004\240\265\030\001\022?\n\014and_argument\030\006 \003(" +
|
||||
"\0132).org.jetbrains.kotlin.metadata.Expres" +
|
||||
"sion\022>\n\013or_argument\030\007 \003(\0132).org.jetbrain" +
|
||||
"s.kotlin.metadata.Expression\".\n\rConstant" +
|
||||
"Value\022\010\n\004TRUE\020\000\022\t\n\005FALSE\020\001\022\010\n\004NULL\020\002*9\n\010" +
|
||||
"Modality\022\t\n\005FINAL\020\000\022\010\n\004OPEN\020\001\022\014\n\010ABSTRAC" +
|
||||
"T\020\002\022\n\n\006SEALED\020\003*b\n\nVisibility\022\014\n\010INTERNA",
|
||||
"L\020\000\022\013\n\007PRIVATE\020\001\022\r\n\tPROTECTED\020\002\022\n\n\006PUBLI" +
|
||||
"C\020\003\022\023\n\017PRIVATE_TO_THIS\020\004\022\t\n\005LOCAL\020\005*Q\n\nM" +
|
||||
"emberKind\022\017\n\013DECLARATION\020\000\022\021\n\rFAKE_OVERR" +
|
||||
"IDE\020\001\022\016\n\nDELEGATION\020\002\022\017\n\013SYNTHESIZED\020\003B\017" +
|
||||
"B\rDebugProtoBuf"
|
||||
};
|
||||
org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
|
||||
new org.jetbrains.kotlin.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
|
||||
@@ -34587,7 +34949,7 @@ public final class DebugProtoBuf {
|
||||
internal_static_org_jetbrains_kotlin_metadata_Class_fieldAccessorTable = new
|
||||
org.jetbrains.kotlin.protobuf.GeneratedMessage.FieldAccessorTable(
|
||||
internal_static_org_jetbrains_kotlin_metadata_Class_descriptor,
|
||||
new java.lang.String[] { "Flags", "FqName", "CompanionObjectName", "TypeParameter", "Supertype", "SupertypeId", "NestedClassName", "Constructor", "Function", "Property", "TypeAlias", "EnumEntry", "SealedSubclassFqName", "TypeTable", "VersionRequirement", "VersionRequirementTable", });
|
||||
new java.lang.String[] { "Flags", "FqName", "CompanionObjectName", "TypeParameter", "Supertype", "SupertypeId", "NestedClassName", "Constructor", "Function", "Property", "TypeAlias", "EnumEntry", "SealedSubclassFqName", "InlineClassUnderlyingPropertyName", "InlineClassUnderlyingType", "InlineClassUnderlyingTypeId", "TypeTable", "VersionRequirement", "VersionRequirementTable", });
|
||||
internal_static_org_jetbrains_kotlin_metadata_Package_descriptor =
|
||||
getDescriptor().getMessageTypes().get(6);
|
||||
internal_static_org_jetbrains_kotlin_metadata_Package_fieldAccessorTable = new
|
||||
@@ -34696,6 +35058,8 @@ public final class DebugProtoBuf {
|
||||
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
|
||||
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
|
||||
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.fqNameIdInTable);
|
||||
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
|
||||
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
|
||||
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.skipMessageInComparison);
|
||||
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.nameIdInTable);
|
||||
registry.add(org.jetbrains.kotlin.metadata.DebugExtOptionsProtoBuf.typeIdInTable);
|
||||
|
||||
@@ -183,7 +183,7 @@ extra["versions.jflex"] = "1.7.0"
|
||||
extra["versions.markdown"] = "0.1.25"
|
||||
extra["versions.trove4j"] = "1.0.20181211"
|
||||
extra["versions.completion-ranking-kotlin"] = "0.1.3"
|
||||
extra["versions.r8"] = "2.1.75"
|
||||
extra["versions.r8"] = "2.1.96"
|
||||
val immutablesVersion = "0.3.1"
|
||||
extra["versions.kotlinx-collections-immutable"] = immutablesVersion
|
||||
extra["versions.kotlinx-collections-immutable-jvm"] = immutablesVersion
|
||||
@@ -192,7 +192,7 @@ extra["versions.kotlinx-collections-immutable-jvm"] = immutablesVersion
|
||||
extra["versions.ktor-network"] = "1.0.1"
|
||||
|
||||
if (!project.hasProperty("versions.kotlin-native")) {
|
||||
extra["versions.kotlin-native"] = "1.5-dev-17775"
|
||||
extra["versions.kotlin-native"] = "1.5.20-dev-3553"
|
||||
}
|
||||
|
||||
val intellijUltimateEnabled by extra(project.kotlinBuildProperties.intellijUltimateEnabled)
|
||||
|
||||
@@ -28,6 +28,7 @@ val kotlinGradlePluginAndItsRequired = arrayOf(
|
||||
":kotlin-noarg",
|
||||
":kotlin-sam-with-receiver",
|
||||
":kotlin-android-extensions",
|
||||
":kotlin-android-extensions-runtime",
|
||||
":kotlin-parcelize-compiler",
|
||||
":kotlin-build-common",
|
||||
":kotlin-compiler-embeddable",
|
||||
@@ -40,6 +41,7 @@ val kotlinGradlePluginAndItsRequired = arrayOf(
|
||||
":kotlin-gradle-plugin-api",
|
||||
":kotlin-gradle-plugin",
|
||||
":kotlin-gradle-plugin-model",
|
||||
":kotlin-tooling-metadata",
|
||||
":kotlin-reflect",
|
||||
":kotlin-annotation-processing-gradle",
|
||||
":kotlin-test",
|
||||
@@ -55,9 +57,11 @@ val kotlinGradlePluginAndItsRequired = arrayOf(
|
||||
":kotlin-scripting-jvm",
|
||||
":kotlin-scripting-compiler-embeddable",
|
||||
":kotlin-scripting-compiler-impl-embeddable",
|
||||
":kotlin-serialization",
|
||||
":kotlin-test-js-runner",
|
||||
":native:kotlin-klib-commonizer-embeddable",
|
||||
":native:kotlin-klib-commonizer-api"
|
||||
":native:kotlin-klib-commonizer-api",
|
||||
":native:kotlin-native-utils"
|
||||
)
|
||||
|
||||
fun Task.dependsOnKotlinGradlePluginInstall() {
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* 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.backend.common
|
||||
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
|
||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.SimpleFunctionDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
|
||||
import org.jetbrains.kotlin.resolve.sam.getAbstractMembers
|
||||
import org.jetbrains.kotlin.types.*
|
||||
import org.jetbrains.kotlin.types.typeUtil.replaceArgumentsWithNothing
|
||||
|
||||
class SamType constructor(val type: KotlinType) {
|
||||
|
||||
val classDescriptor: ClassDescriptor
|
||||
get() = type.constructor.declarationDescriptor as? ClassDescriptor ?: error("Sam/Fun interface not a class descriptor: $type")
|
||||
|
||||
val kotlinFunctionType: KotlinType
|
||||
get() = classDescriptor.defaultFunctionTypeForSamInterface!!
|
||||
|
||||
val originalAbstractMethod: SimpleFunctionDescriptor
|
||||
get() = getAbstractMembers(classDescriptor)[0] as SimpleFunctionDescriptor
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
return other is SamType && type == other.type
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return type.hashCode()
|
||||
}
|
||||
|
||||
override fun toString(): String {
|
||||
return "SamType($type)"
|
||||
}
|
||||
}
|
||||
|
||||
open class SamTypeFactory {
|
||||
fun createByValueParameter(valueParameter: ValueParameterDescriptor): SamType? {
|
||||
val singleArgumentType: KotlinType
|
||||
val originalSingleArgumentType: KotlinType?
|
||||
val varargElementType = valueParameter.varargElementType
|
||||
if (varargElementType != null) {
|
||||
singleArgumentType = varargElementType
|
||||
originalSingleArgumentType = valueParameter.original.varargElementType
|
||||
assert(originalSingleArgumentType != null) {
|
||||
"Value parameter and original value parameter have inconsistent varargs: " +
|
||||
valueParameter + "; " + valueParameter.original
|
||||
}
|
||||
} else {
|
||||
singleArgumentType = valueParameter.type
|
||||
originalSingleArgumentType = valueParameter.original.type
|
||||
}
|
||||
if (singleArgumentType.isError || originalSingleArgumentType!!.isError) {
|
||||
return null
|
||||
}
|
||||
// This can be true in case when the value parameter is in the method of a generic type with out-projection.
|
||||
// We approximate Inv<Captured#1> to Nothing, while Inv itself can be a SAM interface safe to call here
|
||||
// (see testData genericSamProjectedOut.kt for details)
|
||||
// In such a case we can't have a proper supertype since wildcards are not allowed there,
|
||||
// so we use Nothing arguments instead that leads to a raw type used for a SAM wrapper.
|
||||
// See org.jetbrains.kotlin.codegen.state.KotlinTypeMapper#writeGenericType to understand how
|
||||
// raw types and Nothing arguments relate.
|
||||
val originalTypeToUse =
|
||||
if (KotlinBuiltIns.isNothing(singleArgumentType))
|
||||
originalSingleArgumentType.replaceArgumentsWithNothing()
|
||||
else singleArgumentType
|
||||
return create(originalTypeToUse.removeExternalProjections())
|
||||
}
|
||||
|
||||
open fun isSamType(type: KotlinType): Boolean {
|
||||
val descriptor = type.constructor.declarationDescriptor
|
||||
return descriptor is ClassDescriptor && descriptor.isFun
|
||||
}
|
||||
|
||||
fun create(originalType: KotlinType): SamType? {
|
||||
return if (isSamType(originalType)) SamType(originalType) else null
|
||||
}
|
||||
|
||||
private fun KotlinType.removeExternalProjections(): KotlinType {
|
||||
val newArguments = arguments.map { TypeProjectionImpl(Variance.INVARIANT, it.type) }
|
||||
return replace(newArguments)
|
||||
}
|
||||
|
||||
companion object {
|
||||
val INSTANCE = SamTypeFactory()
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,7 @@ import org.jetbrains.kotlin.resolve.scopes.receivers.TransientReceiver;
|
||||
import org.jetbrains.kotlin.serialization.DescriptorSerializer;
|
||||
import org.jetbrains.kotlin.types.KotlinType;
|
||||
import org.jetbrains.kotlin.types.SimpleType;
|
||||
import org.jetbrains.kotlin.backend.common.SamType;
|
||||
import org.jetbrains.kotlin.types.expressions.ExpressionTypingUtils;
|
||||
import org.jetbrains.kotlin.util.OperatorNameConventions;
|
||||
import org.jetbrains.org.objectweb.asm.MethodVisitor;
|
||||
|
||||
@@ -92,6 +92,7 @@ import org.jetbrains.kotlin.types.model.KotlinTypeMarker;
|
||||
import org.jetbrains.kotlin.types.model.TypeParameterMarker;
|
||||
import org.jetbrains.kotlin.types.typesApproximation.CapturedTypeApproximationKt;
|
||||
import org.jetbrains.kotlin.util.OperatorNameConventions;
|
||||
import org.jetbrains.kotlin.backend.common.SamType;
|
||||
import org.jetbrains.org.objectweb.asm.Label;
|
||||
import org.jetbrains.org.objectweb.asm.MethodVisitor;
|
||||
import org.jetbrains.org.objectweb.asm.Opcodes;
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* 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.codegen
|
||||
|
||||
import org.jetbrains.kotlin.load.java.sam.JavaSingleAbstractMethodUtils
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.backend.common.SamTypeFactory
|
||||
|
||||
object JvmSamTypeFactory : SamTypeFactory() {
|
||||
override fun isSamType(type: KotlinType) = JavaSingleAbstractMethodUtils.isSamType(type)
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.codegen;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.builtins.KotlinBuiltIns;
|
||||
import org.jetbrains.kotlin.codegen.state.TypeMapperUtilsKt;
|
||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.kotlin.descriptors.ClassifierDescriptor;
|
||||
import org.jetbrains.kotlin.descriptors.SimpleFunctionDescriptor;
|
||||
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor;
|
||||
import org.jetbrains.kotlin.load.java.sam.JavaSingleAbstractMethodUtils;
|
||||
import org.jetbrains.kotlin.resolve.sam.SamConversionResolverImplKt;
|
||||
import org.jetbrains.kotlin.types.KotlinType;
|
||||
import org.jetbrains.kotlin.types.KotlinTypeKt;
|
||||
import org.jetbrains.kotlin.types.typeUtil.TypeUtilsKt;
|
||||
|
||||
public class SamType {
|
||||
@Nullable
|
||||
public static SamType createByValueParameter(@NotNull ValueParameterDescriptor valueParameter) {
|
||||
KotlinType singleArgumentType;
|
||||
KotlinType originalSingleArgumentType;
|
||||
KotlinType varargElementType = valueParameter.getVarargElementType();
|
||||
if (varargElementType != null) {
|
||||
singleArgumentType = varargElementType;
|
||||
originalSingleArgumentType = valueParameter.getOriginal().getVarargElementType();
|
||||
assert originalSingleArgumentType != null :
|
||||
"Value parameter and original value parameter have inconsistent varargs: " +
|
||||
valueParameter + "; " + valueParameter.getOriginal();
|
||||
} else {
|
||||
singleArgumentType = valueParameter.getType();
|
||||
originalSingleArgumentType = valueParameter.getOriginal().getType();
|
||||
}
|
||||
|
||||
if (KotlinTypeKt.isError(singleArgumentType) || KotlinTypeKt.isError(originalSingleArgumentType)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
KotlinType originalTypeToUse =
|
||||
// This can be true in case when the value parameter is in the method of a generic type with out-projection.
|
||||
// We approximate Inv<Captured#1> to Nothing, while Inv itself can be a SAM interface safe to call here
|
||||
// (see testData genericSamProjectedOut.kt for details)
|
||||
KotlinBuiltIns.isNothing(singleArgumentType)
|
||||
// In such a case we can't have a proper supertype since wildcards are not allowed there,
|
||||
// so we use Nothing arguments instead that leads to a raw type used for a SAM wrapper.
|
||||
// See org.jetbrains.kotlin.codegen.state.KotlinTypeMapper#writeGenericType to understand how
|
||||
// raw types and Nothing arguments relate.
|
||||
? TypeUtilsKt.replaceArgumentsWithNothing(originalSingleArgumentType)
|
||||
: singleArgumentType;
|
||||
|
||||
return create(TypeMapperUtilsKt.removeExternalProjections(originalTypeToUse));
|
||||
}
|
||||
public static SamType create(@NotNull KotlinType originalType) {
|
||||
if (!JavaSingleAbstractMethodUtils.isSamType(originalType)) return null;
|
||||
return new SamType(originalType);
|
||||
}
|
||||
|
||||
private final KotlinType type;
|
||||
|
||||
private SamType(@NotNull KotlinType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public KotlinType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ClassDescriptor getClassDescriptor() {
|
||||
ClassifierDescriptor classifier = type.getConstructor().getDeclarationDescriptor();
|
||||
assert classifier instanceof ClassDescriptor : "Sam/Fun interface not a class descriptor: " + classifier;
|
||||
return (ClassDescriptor) classifier;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public KotlinType getKotlinFunctionType() {
|
||||
ClassDescriptor descriptor = getClassDescriptor();
|
||||
//noinspection ConstantConditions
|
||||
return descriptor.getDefaultFunctionTypeForSamInterface();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public SimpleFunctionDescriptor getOriginalAbstractMethod() {
|
||||
return (SimpleFunctionDescriptor) SamConversionResolverImplKt.getAbstractMembers(getClassDescriptor()).get(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof SamType && type.equals(((SamType) o).type);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return type.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "SamType(" + type + ")";
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.resolve.inline.InlineUtil
|
||||
import org.jetbrains.org.objectweb.asm.Type
|
||||
import org.jetbrains.kotlin.backend.common.SamType
|
||||
|
||||
class SamWrapperClasses(private val state: GenerationState) {
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOriginKt;
|
||||
import org.jetbrains.kotlin.resolve.scopes.MemberScope;
|
||||
import org.jetbrains.kotlin.storage.LockBasedStorageManager;
|
||||
import org.jetbrains.kotlin.types.KotlinType;
|
||||
import org.jetbrains.kotlin.backend.common.SamType;
|
||||
import org.jetbrains.kotlin.util.OperatorNameConventions;
|
||||
import org.jetbrains.org.objectweb.asm.Label;
|
||||
import org.jetbrains.org.objectweb.asm.MethodVisitor;
|
||||
|
||||
@@ -56,6 +56,7 @@ import org.jetbrains.kotlin.resolve.scopes.receivers.ExpressionReceiver;
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue;
|
||||
import org.jetbrains.kotlin.resolve.scopes.receivers.TransientReceiver;
|
||||
import org.jetbrains.kotlin.types.KotlinType;
|
||||
import org.jetbrains.kotlin.backend.common.SamType;
|
||||
import org.jetbrains.kotlin.types.checker.KotlinTypeChecker;
|
||||
import org.jetbrains.org.objectweb.asm.Type;
|
||||
|
||||
@@ -861,7 +862,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid {
|
||||
if (valueArguments == null) return;
|
||||
|
||||
for (ValueParameterDescriptor valueParameter : valueParametersWithSAMConversion) {
|
||||
SamType samType = SamType.createByValueParameter(valueParameter);
|
||||
SamType samType = JvmSamTypeFactory.INSTANCE.createByValueParameter(valueParameter);
|
||||
if (samType == null) continue;
|
||||
|
||||
ResolvedValueArgument resolvedValueArgument = valueArguments.get(valueParameter.getIndex());
|
||||
@@ -873,7 +874,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid {
|
||||
}
|
||||
|
||||
private void recordSamTypeOnArgumentExpression(ValueParameterDescriptor valueParameter, ValueArgument valueArgument) {
|
||||
SamType samType = SamType.createByValueParameter(valueParameter);
|
||||
SamType samType = JvmSamTypeFactory.INSTANCE.createByValueParameter(valueParameter);
|
||||
if (samType == null) return;
|
||||
|
||||
recordSamTypeOnArgumentExpression(samType, valueArgument);
|
||||
@@ -955,7 +956,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid {
|
||||
bindingTrace.record(SAM_CONSTRUCTOR_TO_ARGUMENT, expression, argumentExpression);
|
||||
|
||||
//noinspection ConstantConditions
|
||||
SamType samType = SamType.create(callableDescriptor.getReturnType());
|
||||
SamType samType = JvmSamTypeFactory.INSTANCE.create(callableDescriptor.getReturnType());
|
||||
bindingTrace.record(SAM_VALUE, argumentExpression, samType);
|
||||
}
|
||||
|
||||
@@ -972,7 +973,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid {
|
||||
FunctionDescriptor original = SamCodegenUtil.getOriginalIfSamAdapter((FunctionDescriptor) operationDescriptor);
|
||||
if (original == null) return;
|
||||
|
||||
SamType samType = SamType.createByValueParameter(original.getValueParameters().get(0));
|
||||
SamType samType = JvmSamTypeFactory.INSTANCE.createByValueParameter(original.getValueParameters().get(0));
|
||||
if (samType == null) return;
|
||||
|
||||
IElementType token = expression.getOperationToken();
|
||||
@@ -1001,7 +1002,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid {
|
||||
List<KtExpression> indexExpressions = expression.getIndexExpressions();
|
||||
List<ValueParameterDescriptor> parameters = original.getValueParameters();
|
||||
for (ValueParameterDescriptor valueParameter : parameters) {
|
||||
SamType samType = SamType.createByValueParameter(valueParameter);
|
||||
SamType samType = JvmSamTypeFactory.INSTANCE.createByValueParameter(valueParameter);
|
||||
if (samType == null) continue;
|
||||
|
||||
if (isSetter && valueParameter.getIndex() == parameters.size() - 1) {
|
||||
|
||||
@@ -12,7 +12,7 @@ import kotlin.collections.CollectionsKt;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.codegen.JvmCodegenUtil;
|
||||
import org.jetbrains.kotlin.codegen.SamType;
|
||||
import org.jetbrains.kotlin.backend.common.SamType;
|
||||
import org.jetbrains.kotlin.codegen.state.GenerationState;
|
||||
import org.jetbrains.kotlin.codegen.when.WhenByEnumsMapping;
|
||||
import org.jetbrains.kotlin.descriptors.*;
|
||||
|
||||
@@ -44,6 +44,7 @@ import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodSignature
|
||||
import org.jetbrains.kotlin.serialization.DescriptorSerializer
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.typeUtil.makeNullable
|
||||
import org.jetbrains.kotlin.backend.common.SamType
|
||||
import org.jetbrains.kotlin.utils.sure
|
||||
import org.jetbrains.org.objectweb.asm.Label
|
||||
import org.jetbrains.org.objectweb.asm.MethodVisitor
|
||||
|
||||
@@ -201,20 +201,38 @@ class CoroutineTransformerMethodVisitor(
|
||||
|
||||
// When suspension point is inlined, it is in range of fake inliner variables.
|
||||
// Path from TABLESWITCH into unspilling goes to latter part of the range.
|
||||
// In this case the variables are uninitialized, initialize them
|
||||
// In this case the variables are uninitialized, initialize them, and split the local variable
|
||||
// range so that the local variable is only defined when initialized.
|
||||
private fun initializeFakeInlinerVariables(methodNode: MethodNode, stateLabels: List<LabelNode>) {
|
||||
for (stateLabel in stateLabels) {
|
||||
val newRecords = mutableListOf<LocalVariableNode>()
|
||||
for (record in methodNode.localVariables) {
|
||||
if (isFakeLocalVariableForInline(record.name) &&
|
||||
methodNode.instructions.indexOf(record.start) < methodNode.instructions.indexOf(stateLabel) &&
|
||||
methodNode.instructions.indexOf(stateLabel) < methodNode.instructions.indexOf(record.end)
|
||||
) {
|
||||
val newEnd = record.end
|
||||
val newStart = LabelNode()
|
||||
record.end = stateLabel
|
||||
methodNode.instructions.insert(stateLabel, withInstructionAdapter {
|
||||
iconst(0)
|
||||
store(record.index, Type.INT_TYPE)
|
||||
}.also {
|
||||
it.add(newStart)
|
||||
})
|
||||
newRecords.add(
|
||||
LocalVariableNode(
|
||||
record.name,
|
||||
record.desc,
|
||||
record.signature,
|
||||
newStart,
|
||||
newEnd,
|
||||
record.index
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
methodNode.localVariables.addAll(newRecords)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,6 +75,7 @@ import org.jetbrains.kotlin.types.checker.SimpleClassicTypeSystemContext
|
||||
import org.jetbrains.kotlin.types.checker.convertVariance
|
||||
import org.jetbrains.kotlin.types.expressions.ExpressionTypingUtils.*
|
||||
import org.jetbrains.kotlin.types.model.*
|
||||
import org.jetbrains.kotlin.backend.common.SamType
|
||||
import org.jetbrains.kotlin.util.OperatorNameConventions
|
||||
import org.jetbrains.org.objectweb.asm.Opcodes.*
|
||||
import org.jetbrains.org.objectweb.asm.Type
|
||||
|
||||
@@ -304,6 +304,7 @@ abstract class CommonCompilerArguments : CommonToolArguments() {
|
||||
)
|
||||
var checkStickyPhaseConditions: Boolean by FreezableVar(false)
|
||||
|
||||
@GradleOption(DefaultValues.BooleanFalseDefault::class)
|
||||
@Argument(
|
||||
value = "-Xuse-fir",
|
||||
description = "Compile using Front-end IR. Warning: this feature is far from being production-ready"
|
||||
|
||||
@@ -471,6 +471,14 @@ default: `indy-with-constants` for JVM target 9 or greater, `inline` otherwise""
|
||||
)
|
||||
var suppressDeprecatedJvmTargetWarning: Boolean by FreezableVar(false)
|
||||
|
||||
@Argument(
|
||||
value = "-Xtype-enhancement-improvements-strict-mode",
|
||||
description = "Enable strict mode for some improvements in the type enhancement for loaded Java types based on nullability annotations," +
|
||||
"including freshly supported reading of the type use annotations from class files. " +
|
||||
"See KT-45671 for more details"
|
||||
)
|
||||
var typeEnhancementImprovementsInStrictMode: Boolean by FreezableVar(false)
|
||||
|
||||
override fun configureAnalysisFlags(collector: MessageCollector): MutableMap<AnalysisFlag<*>, Any> {
|
||||
val result = super.configureAnalysisFlags(collector)
|
||||
result[JvmAnalysisFlags.strictMetadataVersionSemantics] = strictMetadataVersionSemantics
|
||||
@@ -502,6 +510,9 @@ default: `indy-with-constants` for JVM target 9 or greater, `inline` otherwise""
|
||||
if (strictJavaNullabilityAssertions) {
|
||||
result[LanguageFeature.StrictJavaNullabilityAssertions] = LanguageFeature.State.ENABLED
|
||||
}
|
||||
if (typeEnhancementImprovementsInStrictMode) {
|
||||
result[LanguageFeature.TypeEnhancementImprovementsInStrictMode] = LanguageFeature.State.ENABLED
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class JitCompilationMeasurement(private val milliseconds: Long) : PerformanceMea
|
||||
override fun render(): String = "JIT time is $milliseconds ms"
|
||||
}
|
||||
|
||||
class CompilerInitializationMeasurement(private val milliseconds: Long) : PerformanceMeasurement {
|
||||
class CompilerInitializationMeasurement(val milliseconds: Long) : PerformanceMeasurement {
|
||||
override fun render(): String = "INIT: Compiler initialized in $milliseconds ms"
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class JvmPackagePartProvider(
|
||||
languageVersionSettings: LanguageVersionSettings,
|
||||
private val scope: GlobalSearchScope
|
||||
) : JvmPackagePartProviderBase<VirtualFile>() {
|
||||
private val deserializationConfiguration = CompilerDeserializationConfiguration(languageVersionSettings)
|
||||
override val deserializationConfiguration = CompilerDeserializationConfiguration(languageVersionSettings)
|
||||
|
||||
override val loadedModules: MutableList<ModuleMappingInfo<VirtualFile>> = SmartList()
|
||||
|
||||
|
||||
@@ -689,7 +689,7 @@ class KotlinCoreEnvironment private constructor(
|
||||
// For example, see the `unregisterExtension` call in `GenerationUtils.compileFilesUsingFrontendIR`.
|
||||
// TODO: refactor this to avoid registering unneeded extensions in the first place, and avoid using deprecated API.
|
||||
@Suppress("DEPRECATION")
|
||||
PsiElementFinder.EP.getPoint(project).registerExtension(JavaElementFinder(this, kotlinAsJavaSupport))
|
||||
PsiElementFinder.EP.getPoint(project).registerExtension(JavaElementFinder(this))
|
||||
@Suppress("DEPRECATION")
|
||||
PsiElementFinder.EP.getPoint(project).registerExtension(PsiElementFinderImpl(this))
|
||||
}
|
||||
|
||||
@@ -683,7 +683,7 @@ class KotlinCoreEnvironment private constructor(
|
||||
// For example, see the `unregisterExtension` call in `GenerationUtils.compileFilesUsingFrontendIR`.
|
||||
// TODO: refactor this to avoid registering unneeded extensions in the first place, and avoid using deprecated API.
|
||||
@Suppress("DEPRECATION")
|
||||
PsiElementFinder.EP.getPoint(project).registerExtension(JavaElementFinder(this, kotlinAsJavaSupport))
|
||||
PsiElementFinder.EP.getPoint(project).registerExtension(JavaElementFinder(this))
|
||||
@Suppress("DEPRECATION")
|
||||
PsiElementFinder.EP.getPoint(project).registerExtension(PsiElementFinderImpl(this))
|
||||
}
|
||||
|
||||
@@ -61,6 +61,7 @@ import org.jetbrains.kotlin.fir.createSessionWithDependencies
|
||||
import org.jetbrains.kotlin.ir.backend.jvm.jvmResolveLibraries
|
||||
import org.jetbrains.kotlin.javac.JavacWrapper
|
||||
import org.jetbrains.kotlin.load.kotlin.ModuleVisibilityManager
|
||||
import org.jetbrains.kotlin.load.kotlin.incremental.IncrementalPackagePartProvider
|
||||
import org.jetbrains.kotlin.modules.Module
|
||||
import org.jetbrains.kotlin.modules.TargetId
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
@@ -308,12 +309,19 @@ object KotlinToJVMBytecodeCompiler {
|
||||
val projectConfiguration = environment.configuration
|
||||
val localFileSystem = VirtualFileManager.getInstance().getFileSystem(StandardFileSystems.FILE_PROTOCOL)
|
||||
val outputs = newLinkedHashMapWithExpectedSize<Module, GenerationState>(chunk.size)
|
||||
val targetIds = environment.configuration.get(JVMConfigurationKeys.MODULES)?.map(::TargetId)
|
||||
val incrementalComponents = environment.configuration.get(JVMConfigurationKeys.INCREMENTAL_COMPILATION_COMPONENTS)
|
||||
for (module in chunk) {
|
||||
performanceManager?.notifyAnalysisStarted()
|
||||
ProgressIndicatorAndCompilationCanceledStatus.checkCanceled()
|
||||
|
||||
val ktFiles = module.getSourceFiles(environment, localFileSystem, chunk.size > 1, buildFile)
|
||||
if (!checkKotlinPackageUsage(environment, ktFiles)) return false
|
||||
|
||||
val syntaxErrors = ktFiles.fold(false) { errorsFound, ktFile ->
|
||||
AnalyzerWithCompilerReport.reportSyntaxErrors(ktFile, environment.messageCollector).isHasErrors or errorsFound
|
||||
}
|
||||
|
||||
val moduleConfiguration = projectConfiguration.applyModuleProperties(module, buildFile)
|
||||
|
||||
val sourceScope = GlobalSearchScope.filesScope(project, ktFiles.map { it.virtualFile })
|
||||
@@ -328,7 +336,15 @@ object KotlinToJVMBytecodeCompiler {
|
||||
languageVersionSettings,
|
||||
sourceScope,
|
||||
librariesScope,
|
||||
environment::createPackagePartProvider
|
||||
lookupTracker = environment.configuration.get(CommonConfigurationKeys.LOOKUP_TRACKER),
|
||||
getPackagePartProvider = { environment.createPackagePartProvider(it) },
|
||||
getAdditionalModulePackagePartProvider = {
|
||||
if (targetIds == null || incrementalComponents == null) null
|
||||
else IncrementalPackagePartProvider(
|
||||
environment.createPackagePartProvider(it),
|
||||
targetIds.map(incrementalComponents::getIncrementalCache)
|
||||
)
|
||||
}
|
||||
) {
|
||||
if (extendedAnalysisMode) {
|
||||
registerExtendedCommonCheckers()
|
||||
@@ -345,7 +361,7 @@ object KotlinToJVMBytecodeCompiler {
|
||||
)
|
||||
performanceManager?.notifyAnalysisFinished()
|
||||
|
||||
if (firDiagnostics.any { it.severity == Severity.ERROR }) {
|
||||
if (syntaxErrors || firDiagnostics.any { it.severity == Severity.ERROR }) {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.jetbrains.kotlin.context.ModuleContext
|
||||
import org.jetbrains.kotlin.context.MutableModuleContext
|
||||
import org.jetbrains.kotlin.context.ProjectContext
|
||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.ModuleCapability
|
||||
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.PackageFragmentProvider
|
||||
import org.jetbrains.kotlin.descriptors.impl.CompositePackageFragmentProvider
|
||||
@@ -143,13 +144,14 @@ object TopDownAnalyzerFacadeForJVM {
|
||||
klibList: List<KotlinLibrary> = emptyList(),
|
||||
implicitsResolutionFilter: ImplicitsExtensionsResolutionFilter? = null,
|
||||
explicitModuleDependencyList: List<ModuleDescriptorImpl> = emptyList(),
|
||||
explicitModuleFriendsList: List<ModuleDescriptorImpl> = emptyList()
|
||||
explicitModuleFriendsList: List<ModuleDescriptorImpl> = emptyList(),
|
||||
moduleCapabilities: Map<ModuleCapability<*>, Any?> = emptyMap()
|
||||
): ComponentProvider {
|
||||
val jvmTarget = configuration.get(JVMConfigurationKeys.JVM_TARGET, JvmTarget.DEFAULT)
|
||||
val languageVersionSettings = configuration.languageVersionSettings
|
||||
val jvmPlatform = JvmPlatforms.jvmPlatformByTargetVersion(jvmTarget)
|
||||
|
||||
val moduleContext = createModuleContext(project, configuration, jvmPlatform)
|
||||
val moduleContext = createModuleContext(project, configuration, jvmPlatform, moduleCapabilities)
|
||||
|
||||
val storageManager = moduleContext.storageManager
|
||||
val module = moduleContext.module
|
||||
@@ -215,7 +217,7 @@ object TopDownAnalyzerFacadeForJVM {
|
||||
|
||||
val partProvider = packagePartProvider(sourceScope).let { fragment ->
|
||||
if (targetIds == null || incrementalComponents == null) fragment
|
||||
else IncrementalPackagePartProvider(fragment, targetIds.map(incrementalComponents::getIncrementalCache), storageManager)
|
||||
else IncrementalPackagePartProvider(fragment, targetIds.map(incrementalComponents::getIncrementalCache))
|
||||
}
|
||||
|
||||
// Note that it's necessary to create container for sources _after_ creation of container for dependencies because
|
||||
@@ -318,11 +320,17 @@ object TopDownAnalyzerFacadeForJVM {
|
||||
}
|
||||
}
|
||||
|
||||
private fun createModuleContext(project: Project, configuration: CompilerConfiguration, platform: TargetPlatform?): MutableModuleContext {
|
||||
private fun createModuleContext(
|
||||
project: Project,
|
||||
configuration: CompilerConfiguration,
|
||||
platform: TargetPlatform?,
|
||||
capabilities: Map<ModuleCapability<*>, Any?> = emptyMap()
|
||||
): MutableModuleContext {
|
||||
val projectContext = ProjectContext(project, "TopDownAnalyzer for JVM")
|
||||
val builtIns = JvmBuiltIns(projectContext.storageManager, JvmBuiltIns.Kind.FROM_DEPENDENCIES)
|
||||
return ContextForNewModule(
|
||||
projectContext, Name.special("<${configuration.getNotNull(CommonConfigurationKeys.MODULE_NAME)}>"), builtIns, platform
|
||||
projectContext, Name.special("<${configuration.getNotNull(CommonConfigurationKeys.MODULE_NAME)}>"),
|
||||
builtIns, platform, capabilities
|
||||
).apply {
|
||||
builtIns.builtInsModule = module
|
||||
}
|
||||
|
||||
@@ -202,11 +202,13 @@ fun CompilerConfiguration.configureAdvancedJvmOptions(arguments: K2JVMCompilerAr
|
||||
|
||||
put(JVMConfigurationKeys.PARAMETERS_METADATA, arguments.javaParameters)
|
||||
|
||||
// TODO: ignore previous configuration value when we do not need old backend in scripting by default
|
||||
val useOldBackend = arguments.useOldBackend || (!arguments.useIR && get(JVMConfigurationKeys.IR) == false)
|
||||
val useIR = arguments.useFir ||
|
||||
if (languageVersionSettings.supportsFeature(LanguageFeature.JvmIrEnabledByDefault)) {
|
||||
!arguments.useOldBackend
|
||||
!useOldBackend
|
||||
} else {
|
||||
arguments.useIR && !arguments.useOldBackend
|
||||
arguments.useIR && !useOldBackend
|
||||
}
|
||||
|
||||
if (arguments.useIR && arguments.useOldBackend) {
|
||||
|
||||
@@ -920,6 +920,11 @@ public class LazyBodyIsNotTouchedTilContractsPhaseTestGenerated extends Abstract
|
||||
public void testConstValNotTopLevelOrObject() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/constVal/constValNotTopLevelOrObject.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("constValWithGetterOrDelegate.kt")
|
||||
public void testConstValWithGetterOrDelegate() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/constVal/constValWithGetterOrDelegate.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/fir/analysis-tests/testData/resolve/constructors")
|
||||
|
||||
@@ -28,9 +28,9 @@ fun test_2(a: A<C>) {
|
||||
}
|
||||
|
||||
fun test_3(a: A<D>) {
|
||||
<!AMBIGUITY!>a[0] += D()<!> // ambiguity
|
||||
a[0] <!AMBIGUITY!>+=<!> D() // ambiguity
|
||||
}
|
||||
|
||||
fun test_4(b: B) {
|
||||
<!UNRESOLVED_REFERENCE!><!UNRESOLVED_REFERENCE!>b[0]<!> += B()<!> // unresolved
|
||||
b<!NO_GET_METHOD!>[0]<!> <!UNRESOLVED_REFERENCE!>+=<!> B() // unresolved
|
||||
}
|
||||
|
||||
33
compiler/fir/analysis-tests/testData/resolve/constVal/constValWithGetterOrDelegate.fir.txt
vendored
Normal file
33
compiler/fir/analysis-tests/testData/resolve/constVal/constValWithGetterOrDelegate.fir.txt
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
FILE: constValWithGetterOrDelegate.kt
|
||||
public final const val f: R|kotlin/Int| = Int(24)
|
||||
public get(): R|kotlin/Int|
|
||||
public final const val l: R|kotlin/Int| = Int(3)
|
||||
public get(): R|kotlin/Int|
|
||||
public final const val k: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int|
|
||||
public final const val t: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int| {
|
||||
^ Int(24)
|
||||
}
|
||||
public final class Test : R|kotlin/Any| {
|
||||
public constructor(): R|Test| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public final operator fun getValue(nothing: R|kotlin/Nothing?|, property: R|kotlin/reflect/KProperty<*>|): R|kotlin/Int| {
|
||||
^getValue Int(123)
|
||||
}
|
||||
|
||||
}
|
||||
public final const val delegated: R|kotlin/Int|by R|/Test.Test|()
|
||||
public get(): R|kotlin/Int| {
|
||||
^ D|/delegated|.R|/Test.getValue|(Null(null), ::R|/delegated|)
|
||||
}
|
||||
public final const val e: R|kotlin/Boolean|
|
||||
public get(): R|kotlin/Boolean| {
|
||||
^ Boolean(false)
|
||||
}
|
||||
public final const val property: R|kotlin/String| = String(123)
|
||||
public get(): R|kotlin/String| {
|
||||
^ F|/property|.R|kotlin/String.plus|(String( 123 123))
|
||||
}
|
||||
26
compiler/fir/analysis-tests/testData/resolve/constVal/constValWithGetterOrDelegate.kt
vendored
Normal file
26
compiler/fir/analysis-tests/testData/resolve/constVal/constValWithGetterOrDelegate.kt
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
const val f = 24
|
||||
|
||||
const val l = 3
|
||||
<!CONST_VAL_WITH_GETTER!>get<!>
|
||||
|
||||
<!MUST_BE_INITIALIZED!>const val k: Int<!>
|
||||
<!CONST_VAL_WITH_GETTER!>get<!>
|
||||
|
||||
const val t: Int
|
||||
<!CONST_VAL_WITH_GETTER!>get() = 24<!>
|
||||
|
||||
class Test {
|
||||
operator fun getValue(nothing: Nothing?, property: KProperty<*>): Int {
|
||||
return 123
|
||||
}
|
||||
}
|
||||
|
||||
const val delegated: Int by <!CONST_VAL_WITH_DELEGATE!>Test()<!>
|
||||
|
||||
const val e: Boolean
|
||||
<!CONST_VAL_WITH_GETTER!>get() = false<!>
|
||||
|
||||
const val property: String = "123"
|
||||
<!CONST_VAL_WITH_GETTER!>get() = field + " 123 123"<!>
|
||||
@@ -21,7 +21,7 @@ class LinkedList<T> : java.util.LinkedList<T>()
|
||||
|
||||
package util
|
||||
|
||||
class HashSet<T> : java.util.HashSet<T>
|
||||
class HashSet<T> : <!SUPERTYPE_NOT_INITIALIZED!>java.util.HashSet<T><!>
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
|
||||
@@ -10,18 +10,18 @@ open class A3(x: String, y: String = "") {
|
||||
constructor(x: String, b: Boolean = true) : this(x, x)
|
||||
}
|
||||
|
||||
class B3_1 : <!AMBIGUITY{LT}!><!AMBIGUITY{PSI}!>A3<!>("")<!>
|
||||
class B3_1 : <!AMBIGUITY!>A3<!>("")
|
||||
class B3_2 : A3("", "asas")
|
||||
class B3_3 : A3("", true)
|
||||
class B3_4 : <!NONE_APPLICABLE{LT}!><!NONE_APPLICABLE{PSI}!>A3<!>("", Unit)<!>
|
||||
class B3_4 : <!NONE_APPLICABLE!>A3<!>("", Unit)
|
||||
|
||||
open class A4(val x: Byte)
|
||||
class B4 : <!INAPPLICABLE_CANDIDATE{LT}!><!INAPPLICABLE_CANDIDATE{PSI}!>A4<!>( 1 + 1)<!>
|
||||
class B4 : <!INAPPLICABLE_CANDIDATE!>A4<!>( 1 + 1)
|
||||
|
||||
open class A5 {
|
||||
constructor(x: Byte)
|
||||
constructor(x: Short)
|
||||
}
|
||||
|
||||
class B5_1 : <!NONE_APPLICABLE{LT}!><!NONE_APPLICABLE{PSI}!>A5<!>(1 + 1)<!>
|
||||
class B5_2 : <!NONE_APPLICABLE{LT}!><!NONE_APPLICABLE{PSI}!>A5<!>(100 * 2)<!>
|
||||
class B5_1 : <!NONE_APPLICABLE!>A5<!>(1 + 1)
|
||||
class B5_2 : <!NONE_APPLICABLE!>A5<!>(100 * 2)
|
||||
|
||||
@@ -16,7 +16,7 @@ abstract class A : C() {
|
||||
}
|
||||
}
|
||||
|
||||
class B : A() {
|
||||
<!ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED!>class B<!> : A() {
|
||||
override fun f() {
|
||||
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ fun test(z: Int, c: Char) {}
|
||||
|
||||
}<!>
|
||||
|
||||
<!REDECLARATION!>class B : A {
|
||||
<!REDECLARATION!>class B : <!SUPERTYPE_NOT_INITIALIZED!>A<!> {
|
||||
<!CONFLICTING_OVERLOADS!>override fun rest(s: String)<!> {}
|
||||
|
||||
<!CONFLICTING_OVERLOADS!>fun rest(s: String)<!> {}
|
||||
|
||||
@@ -22,7 +22,7 @@ abstract class K {
|
||||
<!INCOMPATIBLE_MODIFIERS!>private<!> <!INCOMPATIBLE_MODIFIERS!>abstract<!> val i2: Int
|
||||
}
|
||||
|
||||
private open class L : K()
|
||||
private open <!INVISIBLE_ABSTRACT_MEMBER_FROM_SUPER!>class L<!> : K()
|
||||
private abstract class M : K()
|
||||
|
||||
class X {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
interface A {
|
||||
<!ANY_METHOD_IMPLEMENTED_IN_INTERFACE!>override fun toString() = "Hello"<!>
|
||||
<!ANY_METHOD_IMPLEMENTED_IN_INTERFACE!>override fun equals(other: Any?) = true<!>
|
||||
<!ANY_METHOD_IMPLEMENTED_IN_INTERFACE!>override fun hashCode(): Int {
|
||||
<!METHOD_OF_ANY_IMPLEMENTED_IN_INTERFACE!>override fun toString() = "Hello"<!>
|
||||
<!METHOD_OF_ANY_IMPLEMENTED_IN_INTERFACE!>override fun equals(other: Any?) = true<!>
|
||||
<!METHOD_OF_ANY_IMPLEMENTED_IN_INTERFACE!>override fun hashCode(): Int {
|
||||
return 42;
|
||||
}<!>
|
||||
}
|
||||
@@ -13,9 +13,9 @@ interface B {
|
||||
}
|
||||
|
||||
interface C {
|
||||
<!ANY_METHOD_IMPLEMENTED_IN_INTERFACE!>override operator fun toString(): String = "Rest"<!>
|
||||
<!ANY_METHOD_IMPLEMENTED_IN_INTERFACE!>override operator fun equals(other: Any?): Boolean = false<!>
|
||||
<!ANY_METHOD_IMPLEMENTED_IN_INTERFACE!>override operator fun hashCode(): Int = 2<!>
|
||||
<!METHOD_OF_ANY_IMPLEMENTED_IN_INTERFACE!>override operator fun toString(): String = "Rest"<!>
|
||||
<!METHOD_OF_ANY_IMPLEMENTED_IN_INTERFACE!>override operator fun equals(other: Any?): Boolean = false<!>
|
||||
<!METHOD_OF_ANY_IMPLEMENTED_IN_INTERFACE!>override operator fun hashCode(): Int = 2<!>
|
||||
}
|
||||
|
||||
interface D {
|
||||
|
||||
@@ -2,7 +2,7 @@ class A {
|
||||
fun f() {}
|
||||
}
|
||||
|
||||
class B : A {
|
||||
class B : <!SUPERTYPE_NOT_INITIALIZED!>A<!> {
|
||||
fun g() {
|
||||
<!NOT_A_SUPERTYPE!>super<String><!>.<!UNRESOLVED_REFERENCE!>f<!>()
|
||||
super<A>.f()
|
||||
|
||||
@@ -2,7 +2,7 @@ open class A {
|
||||
open var test: Number = 10
|
||||
}
|
||||
|
||||
open class B : A {
|
||||
open class B : <!SUPERTYPE_NOT_INITIALIZED!>A<!> {
|
||||
override var test: <!VAR_TYPE_MISMATCH_ON_OVERRIDE!>Double<!> = 20.0
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ class G<E : Double>(val balue: E) : F<E>(balue) {
|
||||
override var rest: E = balue
|
||||
}
|
||||
|
||||
class H<E : String>(val balue: E) : <!INAPPLICABLE_CANDIDATE{LT}!><!INAPPLICABLE_CANDIDATE{PSI}!>F<E><!>(balue)<!> {
|
||||
class H<E : String>(val balue: E) : <!INAPPLICABLE_CANDIDATE!>F<E><!>(balue) {
|
||||
override var rest: E = balue // no report because of INAPPLICABLE_CANDIDATE
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ open class A {
|
||||
open fun test(): Number = 10
|
||||
}
|
||||
|
||||
open class B : A {
|
||||
open class B : <!SUPERTYPE_NOT_INITIALIZED!>A<!> {
|
||||
override fun test(): Double = 20.0
|
||||
fun test(x: Int) = x
|
||||
}
|
||||
@@ -27,7 +27,7 @@ class G<E : Double>(val balue: E) : F<E>(balue) {
|
||||
override fun rest(): E = balue
|
||||
}
|
||||
|
||||
class H<E : String>(val balue: E) : <!INAPPLICABLE_CANDIDATE{LT}!><!INAPPLICABLE_CANDIDATE{PSI}!>F<E><!>(balue)<!> {
|
||||
class H<E : String>(val balue: E) : <!INAPPLICABLE_CANDIDATE!>F<E><!>(balue) {
|
||||
override fun rest(): E = balue // no report because of INAPPLICABLE_CANDIDATE
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
class A
|
||||
class B : A
|
||||
class B : <!SUPERTYPE_NOT_INITIALIZED!>A<!>
|
||||
|
||||
class C(x: Int)
|
||||
<!INAPPLICABLE_CANDIDATE!>class D : C<!>
|
||||
<!INAPPLICABLE_CANDIDATE!>class D : <!SUPERTYPE_NOT_INITIALIZED!>C<!><!>
|
||||
class E : C(10)
|
||||
class F() : C(10)
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ 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|B<A>| = R|/B.B|<<ERROR TYPE REF: Symbol not found, for `UnexistingType`>>()
|
||||
lval b5: R|B<B<ERROR CLASS: Symbol not found, for `UnexistingType`>>| = R|/B.B|<R|B<ERROR CLASS: Symbol not found, for `UnexistingType`>|>()
|
||||
lval b4: R|B<A>| = R|/B.B|<<ERROR TYPE REF: Symbol not found for UnexistingType>>()
|
||||
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|>()
|
||||
R|/fest|<R|C|>()
|
||||
|
||||
@@ -26,11 +26,11 @@ enum class EnumClass {
|
||||
override val bar: String = "a"
|
||||
},
|
||||
|
||||
E2 {
|
||||
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>E2<!> {
|
||||
|
||||
},
|
||||
|
||||
E3();
|
||||
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>E3<!>();
|
||||
|
||||
abstract fun foo(): Int
|
||||
abstract val bar: String
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
sealed class Base
|
||||
|
||||
class A : Base
|
||||
class A : <!SUPERTYPE_NOT_INITIALIZED!>Base<!>
|
||||
|
||||
// FILE: b.kt
|
||||
|
||||
|
||||
@@ -15,13 +15,13 @@ class CallBasedInExpressionGenerator(
|
||||
operatorReference: KtSimpleNameExpression
|
||||
) : InExpressionGenerator {
|
||||
private val resolvedCall = operatorReference.<!UNRESOLVED_REFERENCE!>getResolvedCallWithAssert<!>(codegen.<!UNRESOLVED_REFERENCE!>bindingContext<!>)
|
||||
private val isInverted = operatorReference.<!UNRESOLVED_REFERENCE!>getReferencedNameElementType<!>() == <!UNRESOLVED_REFERENCE!>KtTokens<!>.<!UNRESOLVED_REFERENCE!>NOT_IN<!>
|
||||
private val isInverted = operatorReference.<!UNRESOLVED_REFERENCE!>getReferencedNameElementType<!>() == <!UNRESOLVED_REFERENCE!>KtTokens<!>.NOT_IN
|
||||
|
||||
override fun generate(argument: StackValue): BranchedValue =
|
||||
gen(argument).let { if (isInverted) <!UNRESOLVED_REFERENCE!>Invert<!>(it) else it }
|
||||
|
||||
private fun gen(argument: StackValue): BranchedValue =
|
||||
object : <!INAPPLICABLE_CANDIDATE{LT}!><!INAPPLICABLE_CANDIDATE{PSI}!>BranchedValue<!>(argument, null, argument.<!UNRESOLVED_REFERENCE!>type<!>, <!UNRESOLVED_REFERENCE!>Opcodes<!>.<!UNRESOLVED_REFERENCE!>IFEQ<!>)<!> {
|
||||
object : <!INAPPLICABLE_CANDIDATE!>BranchedValue<!>(argument, null, argument.<!UNRESOLVED_REFERENCE!>type<!>, <!UNRESOLVED_REFERENCE!>Opcodes<!>.IFEQ) {
|
||||
override fun putSelector(type: Type, kotlinType: KotlinType?, v: InstructionAdapter) {
|
||||
invokeFunction(v)
|
||||
<!UNRESOLVED_REFERENCE!>coerceTo<!>(type, kotlinType, v)
|
||||
@@ -29,7 +29,7 @@ class CallBasedInExpressionGenerator(
|
||||
|
||||
override fun condJump(jumpLabel: Label, v: InstructionAdapter, jumpIfFalse: Boolean) {
|
||||
invokeFunction(v)
|
||||
v.<!UNRESOLVED_REFERENCE!>visitJumpInsn<!>(if (jumpIfFalse) <!UNRESOLVED_REFERENCE!>Opcodes<!>.<!UNRESOLVED_REFERENCE!>IFEQ<!> else <!UNRESOLVED_REFERENCE!>Opcodes<!>.<!UNRESOLVED_REFERENCE!>IFNE<!>, jumpLabel)
|
||||
v.<!UNRESOLVED_REFERENCE!>visitJumpInsn<!>(if (jumpIfFalse) <!UNRESOLVED_REFERENCE!>Opcodes<!>.IFEQ else <!UNRESOLVED_REFERENCE!>Opcodes<!>.IFNE, jumpLabel)
|
||||
}
|
||||
|
||||
private fun invokeFunction(v: InstructionAdapter) {
|
||||
|
||||
@@ -21,7 +21,7 @@ class Bar {
|
||||
}
|
||||
|
||||
// NB! abc() here is resolved to member Foo.abc(), and not to extension member of Bar
|
||||
fun Foo.check() = <!NONE_APPLICABLE{LT}!>abc() <!NONE_APPLICABLE{PSI}!>+<!> bar()<!>
|
||||
fun Foo.check() = abc() <!NONE_APPLICABLE!>+<!> bar()
|
||||
|
||||
// NB! + here is resolved to member String.plus (not to extension member above)
|
||||
fun Foo.check2() = "" + bar()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
class A
|
||||
open class B
|
||||
class C : B
|
||||
class C : <!SUPERTYPE_NOT_INITIALIZED!>B<!>
|
||||
|
||||
|
||||
fun bar(a: A) = a
|
||||
|
||||
@@ -4,10 +4,10 @@ class Your {
|
||||
|
||||
class My {
|
||||
fun foo() {
|
||||
val x = <!UNRESOLVED_REFERENCE!>::Nested<!> // Should be error
|
||||
val x = ::<!UNRESOLVED_REFERENCE!>Nested<!> // Should be error
|
||||
}
|
||||
}
|
||||
|
||||
fun Your.foo() {
|
||||
val x = <!UNRESOLVED_REFERENCE!>::Nested<!> // Still should be error
|
||||
val x = ::<!UNRESOLVED_REFERENCE!>Nested<!> // Still should be error
|
||||
}
|
||||
|
||||
@@ -14,6 +14,6 @@ public abstract class Decorator<T extends LookupElement> extends LookupElement {
|
||||
|
||||
// FILE: test.kt
|
||||
|
||||
class MyDecorator : Decorator<LookupElement> {
|
||||
class MyDecorator : <!SUPERTYPE_NOT_INITIALIZED!>Decorator<LookupElement><!> {
|
||||
override fun getLookupString(): String = delegate.lookupString
|
||||
}
|
||||
|
||||
@@ -18,4 +18,4 @@ fun test() {
|
||||
B.foo()
|
||||
}
|
||||
|
||||
val bb = <!UNRESOLVED_REFERENCE!>B<!>.<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||
val bb = <!UNRESOLVED_REFERENCE!>B<!>.foo()
|
||||
|
||||
@@ -6,5 +6,5 @@ object A {
|
||||
|
||||
object B
|
||||
|
||||
val err = B.<!UNRESOLVED_REFERENCE!>A<!>.<!UNRESOLVED_REFERENCE!>B<!>
|
||||
val err = B.<!UNRESOLVED_REFERENCE!>A<!>.B
|
||||
val correct = A.B.A
|
||||
|
||||
@@ -7,7 +7,7 @@ class Foo {
|
||||
|
||||
fun test_1() {
|
||||
val f = Foo()
|
||||
<!UNRESOLVED_REFERENCE{LT}!>f <!UNRESOLVED_REFERENCE{PSI}!>+<!> f<!>
|
||||
f <!UNRESOLVED_REFERENCE!>+<!> f
|
||||
}
|
||||
|
||||
fun test_2() {
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FILE: fakeRecursiveTypealias.kt
|
||||
public final typealias My = <ERROR TYPE REF: Symbol not found, for `incorrect.directory.My`>
|
||||
public final typealias My = <ERROR TYPE REF: Symbol not found for incorrect.directory.My>
|
||||
public final typealias Your = <ERROR TYPE REF: Loop in supertype: /Your -> /Your>
|
||||
|
||||
@@ -14,6 +14,6 @@ class A {
|
||||
<!VALUE_CLASS_CANNOT_BE_CLONEABLE!>inline<!> class CloneableClass2(val x: Int): java.lang.Cloneable
|
||||
|
||||
open class Test
|
||||
inline class ExtendTest(val x: Int): <!INLINE_CLASS_CANNOT_EXTEND_CLASSES!>Test<!>
|
||||
inline class ExtendTest(val x: Int): <!INLINE_CLASS_CANNOT_EXTEND_CLASSES, SUPERTYPE_NOT_INITIALIZED!>Test<!>
|
||||
|
||||
inline class ImplementByDelegation(val x: Int) : <!INLINE_CLASS_CANNOT_IMPLEMENT_INTERFACE_BY_DELEGATION!>Comparable<Int><!> by x
|
||||
|
||||
@@ -28,7 +28,7 @@ FILE: main.kt
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public abstract fun createTest(): <ERROR TYPE REF: Symbol not found, for `Test`>
|
||||
public abstract fun createTest(): <ERROR TYPE REF: Symbol not found for Test>
|
||||
|
||||
public abstract fun createObj(): R|test/Test.O|
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ package test
|
||||
sealed class Test {
|
||||
object O : Test()
|
||||
|
||||
class Extra(val x: Int): Test
|
||||
class Extra(val x: Int): <!SUPERTYPE_NOT_INITIALIZED!>Test<!>
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
class Outer { inner class Inner }
|
||||
fun test() {
|
||||
val x = object : <!UNRESOLVED_REFERENCE{LT}!><!UNRESOLVED_REFERENCE{PSI}!>Outer.Inner<!>()<!> { }
|
||||
val x = object : <!UNRESOLVED_REFERENCE!>Outer.Inner<!>() { }
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class LightMember<D> : Member<D>, Light() {
|
||||
override fun getName(): String = "Light"
|
||||
}
|
||||
|
||||
public class LightClassWrapper : Light(), Klass {
|
||||
public <!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class LightClassWrapper<!> : Light(), Klass {
|
||||
fun test() = typeParameters.single()
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ class GenericTest {
|
||||
}
|
||||
|
||||
fun test_2() {
|
||||
val extensionValRef = <!UNRESOLVED_REFERENCE!>B<*>::extensionVal<!>
|
||||
val extensionFunRef = <!UNRESOLVED_REFERENCE!>B<*>::extensionFun<!>
|
||||
val extensionValRef = B<*>::<!UNRESOLVED_REFERENCE!>extensionVal<!>
|
||||
val extensionFunRef = B<*>::<!UNRESOLVED_REFERENCE!>extensionFun<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,8 +36,8 @@ class NoGenericTest {
|
||||
fun B.extensionFun(): A = A()
|
||||
|
||||
fun test_1() {
|
||||
val extensionValRef = B::extensionVal
|
||||
val extensionFunRef = B::extensionFun
|
||||
val extensionValRef = B::<!EXTENSION_IN_CLASS_REFERENCE_NOT_ALLOWED!>extensionVal<!>
|
||||
val extensionFunRef = B::<!EXTENSION_IN_CLASS_REFERENCE_NOT_ALLOWED!>extensionFun<!>
|
||||
}
|
||||
|
||||
fun test_2() {
|
||||
|
||||
@@ -23,7 +23,7 @@ fun main() {
|
||||
x <!UNRESOLVED_REFERENCE!>><!> 1
|
||||
}
|
||||
|
||||
JavaUsage.<!INAPPLICABLE_CANDIDATE!>foo<!>({ <!UNRESOLVED_REFERENCE!>it<!> <!UNRESOLVED_REFERENCE!>><!> 1 })
|
||||
JavaUsage.<!INAPPLICABLE_CANDIDATE!>foo<!>({ <!UNRESOLVED_REFERENCE!>it<!> > 1 })
|
||||
|
||||
val x = { x: Int -> x > 1 }
|
||||
|
||||
|
||||
@@ -6,5 +6,5 @@ sealed class WithPrivateConstructor private constructor(val x: Int) {
|
||||
private constructor() : this(42)
|
||||
}
|
||||
|
||||
object First : <!NONE_APPLICABLE{LT}!><!NONE_APPLICABLE{PSI}!>WithPrivateConstructor<!>()<!> // error
|
||||
object Second : <!NONE_APPLICABLE{LT}!><!NONE_APPLICABLE{PSI}!>WithPrivateConstructor<!>(0)<!> // error
|
||||
object First : <!NONE_APPLICABLE!>WithPrivateConstructor<!>() // error
|
||||
object Second : <!NONE_APPLICABLE!>WithPrivateConstructor<!>(0) // error
|
||||
|
||||
@@ -79,7 +79,7 @@ fun test_5(a: A, in1: In1<A>, in2: In1<in A>, in3: In1<out A>) {
|
||||
|
||||
fun test_6(a: A, out1: Out1<A>, out2: Out1<in A>, out3: Out1<out A>) {
|
||||
out1.value().foo()
|
||||
out2.<!UNRESOLVED_REFERENCE!>value<!>().<!UNRESOLVED_REFERENCE!>foo<!>()
|
||||
out2.<!UNRESOLVED_REFERENCE!>value<!>().foo()
|
||||
out3.value().foo()
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ abstract class My<T : Some> {
|
||||
|
||||
abstract val z: <!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>test.My.T<!>
|
||||
|
||||
class Some : <!UNRESOLVED_REFERENCE{LT}!><!SUPERTYPE_NOT_A_CLASS_OR_INTERFACE, UNRESOLVED_REFERENCE{PSI}!>T<!>()<!>
|
||||
class Some : <!SUPERTYPE_NOT_A_CLASS_OR_INTERFACE, UNRESOLVED_REFERENCE!>T<!>()
|
||||
}
|
||||
|
||||
abstract class Your<T : Some> : <!SUPERTYPE_NOT_A_CLASS_OR_INTERFACE!>T<!>
|
||||
|
||||
@@ -92,7 +92,7 @@ FILE: exposedSupertype.kt
|
||||
}
|
||||
|
||||
}
|
||||
public final class Test7 : <ERROR TYPE REF: Symbol not found, for `D.PublicButProtected`> {
|
||||
public final class Test7 : <ERROR TYPE REF: Symbol not found for D.PublicButProtected> {
|
||||
public constructor(): R|Test7| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ private class C {
|
||||
}
|
||||
}
|
||||
|
||||
class D : A {
|
||||
class D : <!SUPERTYPE_NOT_INITIALIZED!>A<!> {
|
||||
class Test1 : A.AProtectedI {
|
||||
|
||||
}
|
||||
@@ -38,11 +38,11 @@ interface E {
|
||||
|
||||
}
|
||||
|
||||
class Test2 : A.APublicI, <!UNRESOLVED_REFERENCE{LT}!><!UNRESOLVED_REFERENCE{PSI}!>B.BInner<!>()<!> {
|
||||
class Test2 : A.APublicI, <!UNRESOLVED_REFERENCE!>B.BInner<!>() {
|
||||
|
||||
}
|
||||
|
||||
class Test3 : C.CPublicI, <!EXPOSED_SUPER_CLASS!>C<!> {
|
||||
class Test3 : C.CPublicI, <!EXPOSED_SUPER_CLASS, SUPERTYPE_NOT_INITIALIZED!>C<!> {
|
||||
|
||||
}
|
||||
|
||||
@@ -50,11 +50,11 @@ class Test4 : E, A.AProtectedI {
|
||||
|
||||
}
|
||||
|
||||
class Test5 : C.CPublicI, <!UNRESOLVED_REFERENCE{LT}!><!UNRESOLVED_REFERENCE{PSI}!>B.BInner<!>()<!> {
|
||||
class Test5 : C.CPublicI, <!UNRESOLVED_REFERENCE!>B.BInner<!>() {
|
||||
|
||||
}
|
||||
|
||||
class Test6 : E, <!EXPOSED_SUPER_CLASS!>C.CPublic<!> {
|
||||
class Test6 : E, <!EXPOSED_SUPER_CLASS, SUPERTYPE_NOT_INITIALIZED!>C.CPublic<!> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@ class A {
|
||||
private inner class Inner
|
||||
}
|
||||
class B {
|
||||
typealias <!EXPOSED_TYPEALIAS_EXPANDED_TYPE!>AInner<!> = A.Inner
|
||||
<!TOPLEVEL_TYPEALIASES_ONLY!>typealias <!EXPOSED_TYPEALIAS_EXPANDED_TYPE!>AInner<!> = A.Inner<!>
|
||||
inner class Inner
|
||||
}
|
||||
|
||||
class C {
|
||||
typealias BInner = B.Inner
|
||||
<!TOPLEVEL_TYPEALIASES_ONLY!>typealias BInner = B.Inner<!>
|
||||
}
|
||||
|
||||
typealias <!EXPOSED_TYPEALIAS_EXPANDED_TYPE!>AInner0<!> = A.Inner
|
||||
@@ -15,4 +15,4 @@ typealias BInner0 = B.Inner
|
||||
|
||||
private typealias MyString = String
|
||||
|
||||
fun foo(): MyString = ""
|
||||
fun foo(): MyString = ""
|
||||
@@ -23,7 +23,7 @@ internal class Test4<T: B>
|
||||
// valid, B is internal
|
||||
private class Test5<T: B>
|
||||
|
||||
public class Container : C {
|
||||
public class Container : <!SUPERTYPE_NOT_INITIALIZED!>C<!> {
|
||||
// valid, D is protected in C
|
||||
protected class Test6<T: C.D>
|
||||
|
||||
|
||||
@@ -19,5 +19,5 @@ abstract class A {
|
||||
// FILE: main.kt
|
||||
|
||||
fun test(b: B): String {
|
||||
return <!HIDDEN{LT}!>b <!HIDDEN{PSI}!>foo<!> "hello"<!> // should be an error
|
||||
return b <!HIDDEN!>foo<!> "hello" // should be an error
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ fun <T, R> foobaz(x: T): R = TODO()
|
||||
|
||||
fun foo() {
|
||||
val x: (String) -> Int = ::bar
|
||||
val y = <!UNRESOLVED_REFERENCE!>::bar<!>
|
||||
val y = ::<!UNRESOLVED_REFERENCE!>bar<!>
|
||||
val z = ::baz
|
||||
val w: (String) -> Int = ::foobaz
|
||||
|
||||
|
||||
@@ -34,13 +34,13 @@ fun main() {
|
||||
<!AMBIGUITY!>foo3<!>(KotlinClass::baz)
|
||||
|
||||
// Type mismatch
|
||||
<!INAPPLICABLE_CANDIDATE!>foo1<!>(<!UNRESOLVED_REFERENCE!>KotlinClass::bar<!>)
|
||||
<!INAPPLICABLE_CANDIDATE!>foo1<!>(KotlinClass::<!UNRESOLVED_REFERENCE!>bar<!>)
|
||||
foo2(KotlinClass::bar)
|
||||
foo3(KotlinClass::bar)
|
||||
|
||||
foo1(KotlinClass2::bar)
|
||||
// Type mismatch
|
||||
<!INAPPLICABLE_CANDIDATE!>foo2<!>(<!UNRESOLVED_REFERENCE!>KotlinClass2::bar<!>)
|
||||
<!INAPPLICABLE_CANDIDATE!>foo2<!>(KotlinClass2::<!UNRESOLVED_REFERENCE!>bar<!>)
|
||||
foo3(KotlinClass2::bar)
|
||||
}
|
||||
|
||||
|
||||
@@ -4,5 +4,5 @@ fun foo(y: String) {}
|
||||
fun <T> bar(f: (T) -> Unit) {}
|
||||
|
||||
fun test() {
|
||||
bar(<!UNRESOLVED_REFERENCE!>::foo<!>)
|
||||
bar(::<!UNRESOLVED_REFERENCE!>foo<!>)
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ fun test() {
|
||||
|
||||
val t3 = bar(::baz)
|
||||
|
||||
bar(<!UNRESOLVED_REFERENCE!>::foo<!>)
|
||||
bar(::<!UNRESOLVED_REFERENCE!>foo<!>)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,5 +22,5 @@ fun test() {
|
||||
|
||||
val a6 = foo(::singleA, ::singleB)
|
||||
|
||||
foo(<!UNRESOLVED_REFERENCE!>::multiple<!>, <!UNRESOLVED_REFERENCE!>::multiple<!>)
|
||||
foo(::<!UNRESOLVED_REFERENCE!>multiple<!>, ::<!UNRESOLVED_REFERENCE!>multiple<!>)
|
||||
}
|
||||
|
||||
@@ -6,14 +6,14 @@ fun IB.extFun(x: IA) {}
|
||||
|
||||
fun test() {
|
||||
val extFun1 = IA::extFun
|
||||
val extFun2 = <!UNRESOLVED_REFERENCE!>IB::extFun<!>
|
||||
val extFun2 = IB::<!UNRESOLVED_REFERENCE!>extFun<!>
|
||||
}
|
||||
|
||||
fun testWithExpectedType() {
|
||||
// NB: should be resolved to kotlin/FunctionX, not kotlin/reflect/FunctionX
|
||||
val extFun_AB_A: IA.(IB) -> Unit = IA::extFun
|
||||
val extFun_AA_B: IA.(IA) -> Unit = <!UNRESOLVED_REFERENCE!>IB::extFun<!>
|
||||
val extFun_AA_B: IA.(IA) -> Unit = IB::<!UNRESOLVED_REFERENCE!>extFun<!>
|
||||
val extFun_BB_A: IB.(IB) -> Unit = IA::extFun
|
||||
val extFun_BA_B: IB.(IA) -> Unit = IB::extFun
|
||||
val extFun_BB_B: IB.(IB) -> Unit = <!UNRESOLVED_REFERENCE!>IB::extFun<!>
|
||||
val extFun_BB_B: IB.(IB) -> Unit = IB::<!UNRESOLVED_REFERENCE!>extFun<!>
|
||||
}
|
||||
|
||||
@@ -7,6 +7,6 @@ fun <T> bar(f: (T) -> Unit, e: T) {}
|
||||
fun <T> baz(e: T, f: (T) -> Unit) {}
|
||||
|
||||
fun test(a: A, b: B) {
|
||||
<!INAPPLICABLE_CANDIDATE!>baz<!>(a, <!UNRESOLVED_REFERENCE!>::fooB<!>)
|
||||
<!INAPPLICABLE_CANDIDATE!>bar<!>(<!UNRESOLVED_REFERENCE!>::fooB<!>, a)
|
||||
<!INAPPLICABLE_CANDIDATE!>baz<!>(a, ::<!UNRESOLVED_REFERENCE!>fooB<!>)
|
||||
<!INAPPLICABLE_CANDIDATE!>bar<!>(::<!UNRESOLVED_REFERENCE!>fooB<!>, a)
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@ fun <T, R> use(x: (T) -> R): (T) -> R = x
|
||||
fun foo() = use(::bar)
|
||||
fun bar(x: String) = 1
|
||||
|
||||
fun loop1() = <!INAPPLICABLE_CANDIDATE!>use<!>(<!UNRESOLVED_REFERENCE!>::loop2<!>)
|
||||
fun loop1() = <!INAPPLICABLE_CANDIDATE!>use<!>(::<!UNRESOLVED_REFERENCE!>loop2<!>)
|
||||
fun loop2() = loop1()
|
||||
|
||||
@@ -6,5 +6,5 @@ fun bar(): Int = 1
|
||||
fun bar(x: String): Int = 1
|
||||
|
||||
fun main() {
|
||||
<!AMBIGUITY!>foo<!>(<!UNRESOLVED_REFERENCE!>::bar<!>)
|
||||
<!AMBIGUITY!>foo<!>(::<!UNRESOLVED_REFERENCE!>bar<!>)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FILE: fillInStackTrace.kt
|
||||
public final fun test(t: R|kotlin/Throwable|): R|kotlin/Unit| {
|
||||
R|<local>/t|.R|java/lang/Throwable.fillInStackTrace|()
|
||||
R|<local>/t|.R|kotlin/Throwable.fillInStackTrace|()
|
||||
}
|
||||
|
||||
@@ -6,17 +6,17 @@ FILE: test.kt
|
||||
|
||||
}
|
||||
public final fun test(e: R|MyException|, stream: R|java/io/PrintStream|): R|kotlin/Unit| {
|
||||
R|<local>/e|.R|java/lang/Throwable.printStackTrace|()
|
||||
R|<local>/e|.R|java/lang/Throwable.printStackTrace|(R|<local>/stream|)
|
||||
lval result: R|ft<kotlin/String, kotlin/String?>| = R|<local>/e|.R|java/lang/Throwable.getLocalizedMessage|()
|
||||
R|<local>/e|.R|kotlin/Throwable.printStackTrace|()
|
||||
R|<local>/e|.R|kotlin/Throwable.printStackTrace|(R|<local>/stream|)
|
||||
lval result: R|ft<kotlin/String, kotlin/String?>| = R|<local>/e|.R|kotlin/Throwable.getLocalizedMessage|()
|
||||
}
|
||||
public final fun test(e: R|YourException|, stream: R|java/io/PrintStream|): R|kotlin/Unit| {
|
||||
R|<local>/e|.R|java/lang/Throwable.printStackTrace|()
|
||||
R|<local>/e|.R|java/lang/Throwable.printStackTrace|(R|<local>/stream|)
|
||||
lval result: R|ft<kotlin/String, kotlin/String?>| = R|<local>/e|.R|java/lang/Throwable.getLocalizedMessage|()
|
||||
R|<local>/e|.R|kotlin/Throwable.printStackTrace|()
|
||||
R|<local>/e|.R|kotlin/Throwable.printStackTrace|(R|<local>/stream|)
|
||||
lval result: R|ft<kotlin/String, kotlin/String?>| = R|<local>/e|.R|kotlin/Throwable.getLocalizedMessage|()
|
||||
}
|
||||
public final fun test(e: R|kotlin/Exception|, stream: R|java/io/PrintStream|): R|kotlin/Unit| {
|
||||
R|<local>/e|.R|java/lang/Throwable.printStackTrace|()
|
||||
R|<local>/e|.R|java/lang/Throwable.printStackTrace|(R|<local>/stream|)
|
||||
lval result: R|ft<kotlin/String, kotlin/String?>| = R|<local>/e|.R|java/lang/Throwable.getLocalizedMessage|()
|
||||
R|<local>/e|.R|kotlin/Throwable.printStackTrace|()
|
||||
R|<local>/e|.R|kotlin/Throwable.printStackTrace|(R|<local>/stream|)
|
||||
lval result: R|ft<kotlin/String, kotlin/String?>| = R|<local>/e|.R|kotlin/Throwable.getLocalizedMessage|()
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@ FILE: K1.kt
|
||||
super<R|J1|>()
|
||||
}
|
||||
|
||||
public final class Q : <ERROR TYPE REF: Symbol not found, for `Nested`> {
|
||||
public final class Q : <ERROR TYPE REF: Symbol not found for Nested> {
|
||||
public constructor(): R|K2.Q| {
|
||||
super<<ERROR TYPE REF: Symbol not found, for `Nested`>>()
|
||||
super<<ERROR TYPE REF: Symbol not found for Nested>>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
27
compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/lightMember.fir.txt
vendored
Normal file
27
compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/lightMember.fir.txt
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
FILE: lightMember.kt
|
||||
public abstract interface PsiMember : R|kotlin/Any| {
|
||||
}
|
||||
public abstract interface PsiField : R|PsiMember| {
|
||||
}
|
||||
public abstract class LightMemberImpl<out D : R|PsiMember|> : R|kotlin/Any| {
|
||||
public constructor<out D : R|PsiMember|>(computeRealDelegate: R|() -> D|): R|LightMemberImpl<D>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public open val delegate: R|D|by R|kotlin/lazy|<R|D|>(R|<local>/computeRealDelegate|)
|
||||
public get(): R|D| {
|
||||
^ this@R|/LightMemberImpl|.D|/LightMemberImpl.delegate|.R|kotlin/getValue|<R|D|>(this@R|/LightMemberImpl|, ::R|/LightMemberImpl.delegate|)
|
||||
}
|
||||
|
||||
}
|
||||
public abstract class LightFieldImpl<D : R|PsiField|> : R|LightMemberImpl<PsiField>| {
|
||||
public constructor<D : R|PsiField|>(computeRealDelegate: R|() -> D|): R|LightFieldImpl<D>| {
|
||||
super<R|LightMemberImpl<PsiField>|>(R|<local>/computeRealDelegate|)
|
||||
}
|
||||
|
||||
public open override val delegate: R|D|
|
||||
public get(): R|D| {
|
||||
^ this@R|/LightFieldImpl|.super<R|LightMemberImpl<PsiField>|>.R|SubstitutionOverride</LightMemberImpl.delegate: R|PsiField|>|
|
||||
}
|
||||
|
||||
}
|
||||
12
compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/lightMember.kt
vendored
Normal file
12
compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/lightMember.kt
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
interface PsiMember
|
||||
|
||||
interface PsiField : PsiMember
|
||||
|
||||
abstract class LightMemberImpl<out D : PsiMember>(computeRealDelegate: () -> D) {
|
||||
open val delegate by lazy(computeRealDelegate)
|
||||
}
|
||||
|
||||
abstract class LightFieldImpl<D : PsiField>(computeRealDelegate: () -> D) : LightMemberImpl<PsiField>(computeRealDelegate) {
|
||||
override val delegate: D
|
||||
get() = super.delegate
|
||||
}
|
||||
@@ -1062,6 +1062,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
|
||||
public void testConstValNotTopLevelOrObject() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/constVal/constValNotTopLevelOrObject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("constValWithGetterOrDelegate.kt")
|
||||
public void testConstValWithGetterOrDelegate() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/constVal/constValWithGetterOrDelegate.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@@ -5145,6 +5151,12 @@ public class FirDiagnosticTestGenerated extends AbstractFirDiagnosticTest {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/KJKComplexHierarchyNestedLoop.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lightMember.kt")
|
||||
public void testLightMember() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/lightMember.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("qualifierPriority.kt")
|
||||
public void testQualifierPriority() throws Exception {
|
||||
|
||||
@@ -1071,6 +1071,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
||||
public void testConstValNotTopLevelOrObject() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/constVal/constValNotTopLevelOrObject.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("constValWithGetterOrDelegate.kt")
|
||||
public void testConstValWithGetterOrDelegate() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolve/constVal/constValWithGetterOrDelegate.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
@@ -5219,6 +5225,12 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
|
||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/KJKComplexHierarchyNestedLoop.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("lightMember.kt")
|
||||
public void testLightMember() throws Exception {
|
||||
runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/lightMember.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("qualifierPriority.kt")
|
||||
public void testQualifierPriority() throws Exception {
|
||||
|
||||
@@ -2968,6 +2968,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/tests/callableReference/property"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("backingField.kt")
|
||||
public void testBackingField() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/callableReference/property/backingField.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("classFromClass.kt")
|
||||
public void testClassFromClass() throws Exception {
|
||||
@@ -11759,6 +11765,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/inference/capturedInProjectedFlexibleType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("capturedTypesInSelfType.kt")
|
||||
public void testCapturedTypesInSelfType() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/capturedTypesInSelfType.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("coerceFunctionLiteralToSuspend.kt")
|
||||
public void testCoerceFunctionLiteralToSuspend() throws Exception {
|
||||
@@ -12185,6 +12197,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/inference/nullableUpperBound.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("onlyInputTypesWithMultilevelIncorporation.kt")
|
||||
public void testOnlyInputTypesWithMultilevelIncorporation() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/onlyInputTypesWithMultilevelIncorporation.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("opposite.kt")
|
||||
public void testOpposite() throws Exception {
|
||||
@@ -18281,6 +18299,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
public void testExpectActualInlineClass() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/inlineClasses/expectActualInlineClass.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("jvmInlineExpectValueClass.kt")
|
||||
public void testJvmInlineExpectValueClass() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/multiplatform/inlineClasses/jvmInlineExpectValueClass.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@Nested
|
||||
|
||||
@@ -46,9 +46,11 @@ enum class PositioningStrategy(private val strategy: String? = null) {
|
||||
INNER_MODIFIER,
|
||||
SELECTOR_BY_QUALIFIED,
|
||||
REFERENCE_BY_QUALIFIED,
|
||||
REFERENCED_NAME_BY_QUALIFIED,
|
||||
PRIVATE_MODIFIER,
|
||||
COMPANION_OBJECT,
|
||||
CONST_MODIFIER,
|
||||
ARRAY_ACCESS
|
||||
|
||||
;
|
||||
|
||||
|
||||
@@ -7,10 +7,11 @@ package org.jetbrains.kotlin.fir.checkers.generator.diagnostics
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.PsiTypeElement
|
||||
import org.jetbrains.kotlin.config.LanguageFeature
|
||||
import org.jetbrains.kotlin.config.LanguageVersionSettings
|
||||
import org.jetbrains.kotlin.contracts.description.EventOccurrencesRange
|
||||
import org.jetbrains.kotlin.descriptors.Visibility
|
||||
import org.jetbrains.kotlin.diagnostics.WhenMissingCase
|
||||
import org.jetbrains.kotlin.resolve.ForbiddenNamedArgumentsTarget
|
||||
import org.jetbrains.kotlin.fir.FirEffectiveVisibility
|
||||
import org.jetbrains.kotlin.fir.FirSourceElement
|
||||
import org.jetbrains.kotlin.fir.PrivateForInline
|
||||
@@ -26,11 +27,23 @@ import org.jetbrains.kotlin.fir.types.ConeKotlinType
|
||||
import org.jetbrains.kotlin.lexer.KtModifierKeywordToken
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.resolve.ForbiddenNamedArgumentsTarget
|
||||
import kotlin.properties.PropertyDelegateProvider
|
||||
import kotlin.properties.ReadOnlyProperty
|
||||
|
||||
|
||||
@Suppress("UNUSED_VARIABLE", "LocalVariableName", "ClassName", "unused")
|
||||
@OptIn(PrivateForInline::class)
|
||||
object DIAGNOSTICS_LIST : DiagnosticList() {
|
||||
val MetaErrors by object : DiagnosticGroup("Meta-errors") {
|
||||
val UNSUPPORTED by error<FirSourceElement, PsiElement> {
|
||||
parameter<String>("unsupported")
|
||||
}
|
||||
val UNSUPPORTED_FEATURE by error<FirSourceElement, PsiElement> {
|
||||
parameter<Pair<LanguageFeature, LanguageVersionSettings>>("unsupportedFeature")
|
||||
}
|
||||
}
|
||||
|
||||
val Miscellaneous by object : DiagnosticGroup("Miscellaneous") {
|
||||
val SYNTAX by error<FirSourceElement, PsiElement>()
|
||||
val OTHER_ERROR by error<FirSourceElement, PsiElement>()
|
||||
@@ -54,7 +67,7 @@ object DIAGNOSTICS_LIST : DiagnosticList() {
|
||||
val HIDDEN by error<FirSourceElement, PsiElement>(PositioningStrategy.REFERENCE_BY_QUALIFIED) {
|
||||
parameter<AbstractFirBasedSymbol<*>>("hidden")
|
||||
}
|
||||
val UNRESOLVED_REFERENCE by error<FirSourceElement, PsiElement>(PositioningStrategy.REFERENCE_BY_QUALIFIED) {
|
||||
val UNRESOLVED_REFERENCE by error<FirSourceElement, PsiElement>(PositioningStrategy.REFERENCED_NAME_BY_QUALIFIED) {
|
||||
parameter<String>("reference")
|
||||
}
|
||||
val UNRESOLVED_LABEL by error<FirSourceElement, PsiElement>()
|
||||
@@ -66,16 +79,15 @@ object DIAGNOSTICS_LIST : DiagnosticList() {
|
||||
}
|
||||
|
||||
val SUPER by object : DiagnosticGroup("Super") {
|
||||
val SUPER_IS_NOT_AN_EXPRESSION by error<FirSourceElement, PsiElement>()
|
||||
val SUPER_NOT_AVAILABLE by error<FirSourceElement, PsiElement>()
|
||||
val ABSTRACT_SUPER_CALL by error<FirSourceElement, PsiElement>(PositioningStrategy.REFERENCE_BY_QUALIFIED)
|
||||
val SUPER_IS_NOT_AN_EXPRESSION by error<FirSourceElement, PsiElement>(PositioningStrategy.REFERENCED_NAME_BY_QUALIFIED)
|
||||
val SUPER_NOT_AVAILABLE by error<FirSourceElement, PsiElement>(PositioningStrategy.REFERENCED_NAME_BY_QUALIFIED)
|
||||
val ABSTRACT_SUPER_CALL by error<FirSourceElement, PsiElement>(PositioningStrategy.REFERENCED_NAME_BY_QUALIFIED)
|
||||
val INSTANCE_ACCESS_BEFORE_SUPER_CALL by error<FirSourceElement, PsiElement> {
|
||||
parameter<String>("target")
|
||||
}
|
||||
}
|
||||
|
||||
val SUPERTYPES by object : DiagnosticGroup("Supertypes") {
|
||||
val TYPE_PARAMETER_AS_SUPERTYPE by error<FirSourceElement, PsiElement>()
|
||||
val ENUM_AS_SUPERTYPE by error<FirSourceElement, PsiElement>()
|
||||
val RECURSION_IN_SUPERTYPES by error<FirSourceElement, PsiElement>()
|
||||
val NOT_A_SUPERTYPE by error<FirSourceElement, PsiElement>()
|
||||
@@ -100,10 +112,13 @@ object DIAGNOSTICS_LIST : DiagnosticList() {
|
||||
val NON_PRIVATE_OR_PROTECTED_CONSTRUCTOR_IN_SEALED by error<FirSourceElement, PsiElement>()
|
||||
val CYCLIC_CONSTRUCTOR_DELEGATION_CALL by warning<FirSourceElement, PsiElement>()
|
||||
val PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED by warning<FirSourceElement, PsiElement>(PositioningStrategy.SECONDARY_CONSTRUCTOR_DELEGATION_CALL)
|
||||
val SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR by warning<FirSourceElement, PsiElement>()
|
||||
|
||||
// TODO: change it to KtSuperTypeEntry when possible (after re-targeter implementation)
|
||||
val SUPERTYPE_NOT_INITIALIZED by error<FirSourceElement, KtTypeReference>()
|
||||
val SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR by error<FirSourceElement, PsiElement>()
|
||||
val DELEGATION_SUPER_CALL_IN_ENUM_CONSTRUCTOR by warning<FirSourceElement, PsiElement>()
|
||||
val PRIMARY_CONSTRUCTOR_REQUIRED_FOR_DATA_CLASS by error<FirSourceElement, KtNamedDeclaration>(PositioningStrategy.DECLARATION_NAME)
|
||||
val EXPLICIT_DELEGATION_CALL_REQUIRED by warning<FirSourceElement, PsiElement>(PositioningStrategy.SECONDARY_CONSTRUCTOR_DELEGATION_CALL)
|
||||
val EXPLICIT_DELEGATION_CALL_REQUIRED by error<FirSourceElement, PsiElement>(PositioningStrategy.SECONDARY_CONSTRUCTOR_DELEGATION_CALL)
|
||||
val SEALED_CLASS_CONSTRUCTOR_CALL by error<FirSourceElement, PsiElement>()
|
||||
|
||||
// TODO: Consider creating a parameter list position strategy and report on the parameter list instead
|
||||
@@ -133,9 +148,9 @@ object DIAGNOSTICS_LIST : DiagnosticList() {
|
||||
val EXPOSED_VISIBILITY by object : DiagnosticGroup("Exposed visibility") {
|
||||
val EXPOSED_TYPEALIAS_EXPANDED_TYPE by exposedVisibilityError<KtNamedDeclaration>(PositioningStrategy.DECLARATION_NAME)
|
||||
val EXPOSED_FUNCTION_RETURN_TYPE by exposedVisibilityError<KtNamedDeclaration>(PositioningStrategy.DECLARATION_NAME)
|
||||
|
||||
val EXPOSED_RECEIVER_TYPE by exposedVisibilityError<KtTypeReference>()
|
||||
val EXPOSED_PROPERTY_TYPE by exposedVisibilityError<KtNamedDeclaration>(PositioningStrategy.DECLARATION_NAME)
|
||||
val EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR by exposedVisibilityWarning<KtNamedDeclaration>(PositioningStrategy.DECLARATION_NAME)
|
||||
val EXPOSED_PARAMETER_TYPE by exposedVisibilityError<KtParameter>(/* // NB: for parameter FE 1.0 reports not on a name for some reason */)
|
||||
val EXPOSED_SUPER_INTERFACE by exposedVisibilityError<KtTypeReference>()
|
||||
val EXPOSED_SUPER_CLASS by exposedVisibilityError<KtTypeReference>()
|
||||
@@ -259,7 +274,11 @@ object DIAGNOSTICS_LIST : DiagnosticList() {
|
||||
}
|
||||
|
||||
val REFLECTION by object : DiagnosticGroup("Reflection") {
|
||||
val EXTENSION_IN_CLASS_REFERENCE_NOT_ALLOWED by error<FirSourceElement, KtExpression>(PositioningStrategy.REFERENCE_BY_QUALIFIED) {
|
||||
parameter<FirCallableDeclaration<*>>("referencedDeclaration")
|
||||
}
|
||||
val CALLABLE_REFERENCE_LHS_NOT_A_CLASS by error<FirSourceElement, KtExpression>()
|
||||
val CALLABLE_REFERENCE_TO_ANNOTATION_CONSTRUCTOR by error<FirSourceElement, KtExpression>(PositioningStrategy.REFERENCE_BY_QUALIFIED)
|
||||
|
||||
val CLASS_LITERAL_LHS_NOT_A_CLASS by error<FirSourceElement, KtExpression>()
|
||||
val NULLABLE_TYPE_IN_CLASS_LITERAL_LHS by error<FirSourceElement, KtExpression>()
|
||||
@@ -289,6 +308,31 @@ object DIAGNOSTICS_LIST : DiagnosticList() {
|
||||
parameter<Name>("containingClassName")
|
||||
}
|
||||
|
||||
val ABSTRACT_MEMBER_NOT_IMPLEMENTED by error<FirSourceElement, KtClassOrObject>(PositioningStrategy.DECLARATION_NAME) {
|
||||
parameter<FirClass<*>>("classOrObject")
|
||||
parameter<FirCallableDeclaration<*>>("missingDeclaration")
|
||||
}
|
||||
val ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED by error<FirSourceElement, KtClassOrObject>(PositioningStrategy.DECLARATION_NAME) {
|
||||
parameter<FirClass<*>>("classOrObject")
|
||||
parameter<FirCallableDeclaration<*>>("missingDeclaration")
|
||||
}
|
||||
val INVISIBLE_ABSTRACT_MEMBER_FROM_SUPER by error<FirSourceElement, KtClassOrObject>(PositioningStrategy.DECLARATION_NAME) {
|
||||
parameter<FirClass<*>>("classOrObject")
|
||||
parameter<FirCallableDeclaration<*>>("invisibleDeclaration")
|
||||
}
|
||||
val INVISIBLE_ABSTRACT_MEMBER_FROM_SUPER_WARNING by warning<FirSourceElement, KtClassOrObject>(PositioningStrategy.DECLARATION_NAME) {
|
||||
parameter<FirClass<*>>("classOrObject")
|
||||
parameter<FirCallableDeclaration<*>>("invisibleDeclaration")
|
||||
}
|
||||
val MANY_IMPL_MEMBER_NOT_IMPLEMENTED by error<FirSourceElement, KtClassOrObject>(PositioningStrategy.DECLARATION_NAME) {
|
||||
parameter<FirClass<*>>("classOrObject")
|
||||
parameter<FirCallableDeclaration<*>>("missingDeclaration")
|
||||
}
|
||||
val MANY_INTERFACES_MEMBER_NOT_IMPLEMENTED by error<FirSourceElement, KtClassOrObject>(PositioningStrategy.DECLARATION_NAME) {
|
||||
parameter<FirClass<*>>("classOrObject")
|
||||
parameter<FirCallableDeclaration<*>>("missingDeclaration")
|
||||
}
|
||||
|
||||
val RETURN_TYPE_MISMATCH_ON_OVERRIDE by error<FirSourceElement, KtNamedDeclaration>(PositioningStrategy.DECLARATION_RETURN_TYPE) {
|
||||
parameter<FirMemberDeclaration>("function")
|
||||
parameter<FirMemberDeclaration>("superFunction")
|
||||
@@ -317,7 +361,7 @@ object DIAGNOSTICS_LIST : DiagnosticList() {
|
||||
val REDECLARATION by error<FirSourceElement, PsiElement>() {
|
||||
parameter<Collection<AbstractFirBasedSymbol<*>>>("conflictingDeclarations")
|
||||
}
|
||||
val ANY_METHOD_IMPLEMENTED_IN_INTERFACE by error<FirSourceElement, PsiElement>()
|
||||
val METHOD_OF_ANY_IMPLEMENTED_IN_INTERFACE by error<FirSourceElement, PsiElement>()
|
||||
}
|
||||
|
||||
val INVALID_LOCAL_DECLARATIONS by object : DiagnosticGroup("Invalid local declarations") {
|
||||
@@ -391,6 +435,8 @@ object DIAGNOSTICS_LIST : DiagnosticList() {
|
||||
val EXPECTED_PRIVATE_DECLARATION by error<FirSourceElement, KtModifierListOwner>(PositioningStrategy.VISIBILITY_MODIFIER)
|
||||
val VAL_WITH_SETTER by error<FirSourceElement, KtPropertyAccessor>()
|
||||
val CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT by error<FirSourceElement, KtProperty>(PositioningStrategy.CONST_MODIFIER)
|
||||
val CONST_VAL_WITH_GETTER by error<FirSourceElement, KtProperty>()
|
||||
val CONST_VAL_WITH_DELEGATE by error<FirSourceElement, KtPropertyDelegate>()
|
||||
}
|
||||
|
||||
val MPP_PROJECTS by object : DiagnosticGroup("Multi-platform projects") {
|
||||
@@ -451,12 +497,12 @@ object DIAGNOSTICS_LIST : DiagnosticList() {
|
||||
val UNSAFE_IMPLICIT_INVOKE_CALL by error<FirSourceElement, PsiElement>(PositioningStrategy.REFERENCE_BY_QUALIFIED) {
|
||||
parameter<ConeKotlinType>("receiverType")
|
||||
}
|
||||
val UNSAFE_INFIX_CALL by error<FirSourceElement, KtExpression> {
|
||||
val UNSAFE_INFIX_CALL by error<FirSourceElement, KtExpression>(PositioningStrategy.REFERENCE_BY_QUALIFIED) {
|
||||
parameter<FirExpression>("lhs")
|
||||
parameter<String>("operator")
|
||||
parameter<FirExpression>("rhs")
|
||||
}
|
||||
val UNSAFE_OPERATOR_CALL by error<FirSourceElement, KtExpression> {
|
||||
val UNSAFE_OPERATOR_CALL by error<FirSourceElement, KtExpression>(PositioningStrategy.REFERENCE_BY_QUALIFIED) {
|
||||
parameter<FirExpression>("lhs")
|
||||
parameter<String>("operator")
|
||||
parameter<FirExpression>("rhs")
|
||||
@@ -486,6 +532,15 @@ object DIAGNOSTICS_LIST : DiagnosticList() {
|
||||
}
|
||||
}
|
||||
|
||||
val CONVENTIONS by object : DiagnosticGroup("Conventions") {
|
||||
val NO_GET_METHOD by error<FirSourceElement, KtArrayAccessExpression>(PositioningStrategy.ARRAY_ACCESS)
|
||||
val NO_SET_METHOD by error<FirSourceElement, KtArrayAccessExpression>(PositioningStrategy.ARRAY_ACCESS)
|
||||
}
|
||||
|
||||
val TYPE_ALIAS by object : DiagnosticGroup("Type alias") {
|
||||
val TOPLEVEL_TYPEALIASES_ONLY by error<FirSourceElement, KtTypeAlias>()
|
||||
}
|
||||
|
||||
val EXTENDED_CHECKERS by object : DiagnosticGroup("Extended checkers") {
|
||||
val REDUNDANT_VISIBILITY_MODIFIER by warning<FirSourceElement, KtModifierListOwner>(PositioningStrategy.VISIBILITY_MODIFIER)
|
||||
val REDUNDANT_MODALITY_MODIFIER by warning<FirSourceElement, KtModifierListOwner>(PositioningStrategy.MODALITY_MODIFIER)
|
||||
@@ -506,10 +561,20 @@ object DIAGNOSTICS_LIST : DiagnosticList() {
|
||||
}
|
||||
}
|
||||
|
||||
private inline fun <reified P : PsiElement> DiagnosticGroup.exposedVisibilityError(
|
||||
positioningStrategy: PositioningStrategy = PositioningStrategy.DEFAULT
|
||||
) = error<FirSourceElement, P>(positioningStrategy) {
|
||||
private val exposedVisibilityDiagnosticInit: DiagnosticBuilder.() -> Unit = {
|
||||
parameter<FirEffectiveVisibility>("elementVisibility")
|
||||
parameter<FirMemberDeclaration>("restrictingDeclaration")
|
||||
parameter<FirEffectiveVisibility>("restrictingVisibility")
|
||||
}
|
||||
|
||||
private inline fun <reified P : PsiElement> DiagnosticGroup.exposedVisibilityError(
|
||||
positioningStrategy: PositioningStrategy = PositioningStrategy.DEFAULT
|
||||
): PropertyDelegateProvider<Any?, ReadOnlyProperty<DiagnosticGroup, DiagnosticData>> {
|
||||
return error<FirSourceElement, P>(positioningStrategy, exposedVisibilityDiagnosticInit)
|
||||
}
|
||||
|
||||
private inline fun <reified P : PsiElement> DiagnosticGroup.exposedVisibilityWarning(
|
||||
positioningStrategy: PositioningStrategy = PositioningStrategy.DEFAULT
|
||||
): PropertyDelegateProvider<Any?, ReadOnlyProperty<DiagnosticGroup, DiagnosticData>> {
|
||||
return warning<FirSourceElement, P>(positioningStrategy, exposedVisibilityDiagnosticInit)
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ package org.jetbrains.kotlin.fir.analysis.diagnostics
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import com.intellij.psi.PsiTypeElement
|
||||
import org.jetbrains.kotlin.config.LanguageFeature
|
||||
import org.jetbrains.kotlin.config.LanguageVersionSettings
|
||||
import org.jetbrains.kotlin.contracts.description.EventOccurrencesRange
|
||||
import org.jetbrains.kotlin.descriptors.Visibility
|
||||
import org.jetbrains.kotlin.diagnostics.WhenMissingCase
|
||||
@@ -24,6 +26,7 @@ import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.fir.types.ConeKotlinType
|
||||
import org.jetbrains.kotlin.lexer.KtModifierKeywordToken
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.psi.KtArrayAccessExpression
|
||||
import org.jetbrains.kotlin.psi.KtClassOrObject
|
||||
import org.jetbrains.kotlin.psi.KtDeclaration
|
||||
import org.jetbrains.kotlin.psi.KtDestructuringDeclaration
|
||||
@@ -40,6 +43,7 @@ import org.jetbrains.kotlin.psi.KtProperty
|
||||
import org.jetbrains.kotlin.psi.KtPropertyAccessor
|
||||
import org.jetbrains.kotlin.psi.KtPropertyDelegate
|
||||
import org.jetbrains.kotlin.psi.KtSimpleNameExpression
|
||||
import org.jetbrains.kotlin.psi.KtTypeAlias
|
||||
import org.jetbrains.kotlin.psi.KtTypeParameter
|
||||
import org.jetbrains.kotlin.psi.KtTypeParameterList
|
||||
import org.jetbrains.kotlin.psi.KtTypeReference
|
||||
@@ -52,6 +56,10 @@ import org.jetbrains.kotlin.resolve.ForbiddenNamedArgumentsTarget
|
||||
*/
|
||||
|
||||
object FirErrors {
|
||||
// Meta-errors
|
||||
val UNSUPPORTED by error1<FirSourceElement, PsiElement, String>()
|
||||
val UNSUPPORTED_FEATURE by error1<FirSourceElement, PsiElement, Pair<LanguageFeature, LanguageVersionSettings>>()
|
||||
|
||||
// Miscellaneous
|
||||
val SYNTAX by error0<FirSourceElement, PsiElement>()
|
||||
val OTHER_ERROR by error0<FirSourceElement, PsiElement>()
|
||||
@@ -69,7 +77,7 @@ object FirErrors {
|
||||
|
||||
// Unresolved
|
||||
val HIDDEN by error1<FirSourceElement, PsiElement, AbstractFirBasedSymbol<*>>(SourceElementPositioningStrategies.REFERENCE_BY_QUALIFIED)
|
||||
val UNRESOLVED_REFERENCE by error1<FirSourceElement, PsiElement, String>(SourceElementPositioningStrategies.REFERENCE_BY_QUALIFIED)
|
||||
val UNRESOLVED_REFERENCE by error1<FirSourceElement, PsiElement, String>(SourceElementPositioningStrategies.REFERENCED_NAME_BY_QUALIFIED)
|
||||
val UNRESOLVED_LABEL by error0<FirSourceElement, PsiElement>()
|
||||
val DESERIALIZATION_ERROR by error0<FirSourceElement, PsiElement>()
|
||||
val ERROR_FROM_JAVA_RESOLUTION by error0<FirSourceElement, PsiElement>()
|
||||
@@ -78,13 +86,12 @@ object FirErrors {
|
||||
val NO_THIS by error0<FirSourceElement, PsiElement>()
|
||||
|
||||
// Super
|
||||
val SUPER_IS_NOT_AN_EXPRESSION by error0<FirSourceElement, PsiElement>()
|
||||
val SUPER_NOT_AVAILABLE by error0<FirSourceElement, PsiElement>()
|
||||
val ABSTRACT_SUPER_CALL by error0<FirSourceElement, PsiElement>(SourceElementPositioningStrategies.REFERENCE_BY_QUALIFIED)
|
||||
val SUPER_IS_NOT_AN_EXPRESSION by error0<FirSourceElement, PsiElement>(SourceElementPositioningStrategies.REFERENCED_NAME_BY_QUALIFIED)
|
||||
val SUPER_NOT_AVAILABLE by error0<FirSourceElement, PsiElement>(SourceElementPositioningStrategies.REFERENCED_NAME_BY_QUALIFIED)
|
||||
val ABSTRACT_SUPER_CALL by error0<FirSourceElement, PsiElement>(SourceElementPositioningStrategies.REFERENCED_NAME_BY_QUALIFIED)
|
||||
val INSTANCE_ACCESS_BEFORE_SUPER_CALL by error1<FirSourceElement, PsiElement, String>()
|
||||
|
||||
// Supertypes
|
||||
val TYPE_PARAMETER_AS_SUPERTYPE by error0<FirSourceElement, PsiElement>()
|
||||
val ENUM_AS_SUPERTYPE by error0<FirSourceElement, PsiElement>()
|
||||
val RECURSION_IN_SUPERTYPES by error0<FirSourceElement, PsiElement>()
|
||||
val NOT_A_SUPERTYPE by error0<FirSourceElement, PsiElement>()
|
||||
@@ -104,10 +111,11 @@ object FirErrors {
|
||||
val NON_PRIVATE_OR_PROTECTED_CONSTRUCTOR_IN_SEALED by error0<FirSourceElement, PsiElement>()
|
||||
val CYCLIC_CONSTRUCTOR_DELEGATION_CALL by warning0<FirSourceElement, PsiElement>()
|
||||
val PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED by warning0<FirSourceElement, PsiElement>(SourceElementPositioningStrategies.SECONDARY_CONSTRUCTOR_DELEGATION_CALL)
|
||||
val SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR by warning0<FirSourceElement, PsiElement>()
|
||||
val SUPERTYPE_NOT_INITIALIZED by error0<FirSourceElement, KtTypeReference>()
|
||||
val SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR by error0<FirSourceElement, PsiElement>()
|
||||
val DELEGATION_SUPER_CALL_IN_ENUM_CONSTRUCTOR by warning0<FirSourceElement, PsiElement>()
|
||||
val PRIMARY_CONSTRUCTOR_REQUIRED_FOR_DATA_CLASS by error0<FirSourceElement, KtNamedDeclaration>(SourceElementPositioningStrategies.DECLARATION_NAME)
|
||||
val EXPLICIT_DELEGATION_CALL_REQUIRED by warning0<FirSourceElement, PsiElement>(SourceElementPositioningStrategies.SECONDARY_CONSTRUCTOR_DELEGATION_CALL)
|
||||
val EXPLICIT_DELEGATION_CALL_REQUIRED by error0<FirSourceElement, PsiElement>(SourceElementPositioningStrategies.SECONDARY_CONSTRUCTOR_DELEGATION_CALL)
|
||||
val SEALED_CLASS_CONSTRUCTOR_CALL by error0<FirSourceElement, PsiElement>()
|
||||
val DATA_CLASS_WITHOUT_PARAMETERS by error0<FirSourceElement, KtPrimaryConstructor>()
|
||||
val DATA_CLASS_VARARG_PARAMETER by error0<FirSourceElement, KtParameter>()
|
||||
@@ -133,6 +141,7 @@ object FirErrors {
|
||||
val EXPOSED_FUNCTION_RETURN_TYPE by error3<FirSourceElement, KtNamedDeclaration, FirEffectiveVisibility, FirMemberDeclaration, FirEffectiveVisibility>(SourceElementPositioningStrategies.DECLARATION_NAME)
|
||||
val EXPOSED_RECEIVER_TYPE by error3<FirSourceElement, KtTypeReference, FirEffectiveVisibility, FirMemberDeclaration, FirEffectiveVisibility>()
|
||||
val EXPOSED_PROPERTY_TYPE by error3<FirSourceElement, KtNamedDeclaration, FirEffectiveVisibility, FirMemberDeclaration, FirEffectiveVisibility>(SourceElementPositioningStrategies.DECLARATION_NAME)
|
||||
val EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR by warning3<FirSourceElement, KtNamedDeclaration, FirEffectiveVisibility, FirMemberDeclaration, FirEffectiveVisibility>(SourceElementPositioningStrategies.DECLARATION_NAME)
|
||||
val EXPOSED_PARAMETER_TYPE by error3<FirSourceElement, KtParameter, FirEffectiveVisibility, FirMemberDeclaration, FirEffectiveVisibility>()
|
||||
val EXPOSED_SUPER_INTERFACE by error3<FirSourceElement, KtTypeReference, FirEffectiveVisibility, FirMemberDeclaration, FirEffectiveVisibility>()
|
||||
val EXPOSED_SUPER_CLASS by error3<FirSourceElement, KtTypeReference, FirEffectiveVisibility, FirMemberDeclaration, FirEffectiveVisibility>()
|
||||
@@ -197,7 +206,9 @@ object FirErrors {
|
||||
val TYPE_PARAMETER_AS_REIFIED by error1<FirSourceElement, PsiElement, FirTypeParameterSymbol>()
|
||||
|
||||
// Reflection
|
||||
val EXTENSION_IN_CLASS_REFERENCE_NOT_ALLOWED by error1<FirSourceElement, KtExpression, FirCallableDeclaration<*>>(SourceElementPositioningStrategies.REFERENCE_BY_QUALIFIED)
|
||||
val CALLABLE_REFERENCE_LHS_NOT_A_CLASS by error0<FirSourceElement, KtExpression>()
|
||||
val CALLABLE_REFERENCE_TO_ANNOTATION_CONSTRUCTOR by error0<FirSourceElement, KtExpression>(SourceElementPositioningStrategies.REFERENCE_BY_QUALIFIED)
|
||||
val CLASS_LITERAL_LHS_NOT_A_CLASS by error0<FirSourceElement, KtExpression>()
|
||||
val NULLABLE_TYPE_IN_CLASS_LITERAL_LHS by error0<FirSourceElement, KtExpression>()
|
||||
val EXPRESSION_OF_NULLABLE_TYPE_IN_CLASS_LITERAL_LHS by error1<FirSourceElement, PsiElement, ConeKotlinType>()
|
||||
@@ -207,6 +218,12 @@ object FirErrors {
|
||||
val CANNOT_WEAKEN_ACCESS_PRIVILEGE by error3<FirSourceElement, KtModifierListOwner, Visibility, FirCallableDeclaration<*>, Name>(SourceElementPositioningStrategies.VISIBILITY_MODIFIER)
|
||||
val CANNOT_CHANGE_ACCESS_PRIVILEGE by error3<FirSourceElement, KtModifierListOwner, Visibility, FirCallableDeclaration<*>, Name>(SourceElementPositioningStrategies.VISIBILITY_MODIFIER)
|
||||
val OVERRIDING_FINAL_MEMBER by error2<FirSourceElement, KtNamedDeclaration, FirCallableDeclaration<*>, Name>(SourceElementPositioningStrategies.OVERRIDE_MODIFIER)
|
||||
val ABSTRACT_MEMBER_NOT_IMPLEMENTED by error2<FirSourceElement, KtClassOrObject, FirClass<*>, FirCallableDeclaration<*>>(SourceElementPositioningStrategies.DECLARATION_NAME)
|
||||
val ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED by error2<FirSourceElement, KtClassOrObject, FirClass<*>, FirCallableDeclaration<*>>(SourceElementPositioningStrategies.DECLARATION_NAME)
|
||||
val INVISIBLE_ABSTRACT_MEMBER_FROM_SUPER by error2<FirSourceElement, KtClassOrObject, FirClass<*>, FirCallableDeclaration<*>>(SourceElementPositioningStrategies.DECLARATION_NAME)
|
||||
val INVISIBLE_ABSTRACT_MEMBER_FROM_SUPER_WARNING by warning2<FirSourceElement, KtClassOrObject, FirClass<*>, FirCallableDeclaration<*>>(SourceElementPositioningStrategies.DECLARATION_NAME)
|
||||
val MANY_IMPL_MEMBER_NOT_IMPLEMENTED by error2<FirSourceElement, KtClassOrObject, FirClass<*>, FirCallableDeclaration<*>>(SourceElementPositioningStrategies.DECLARATION_NAME)
|
||||
val MANY_INTERFACES_MEMBER_NOT_IMPLEMENTED by error2<FirSourceElement, KtClassOrObject, FirClass<*>, FirCallableDeclaration<*>>(SourceElementPositioningStrategies.DECLARATION_NAME)
|
||||
val RETURN_TYPE_MISMATCH_ON_OVERRIDE by error2<FirSourceElement, KtNamedDeclaration, FirMemberDeclaration, FirMemberDeclaration>(SourceElementPositioningStrategies.DECLARATION_RETURN_TYPE)
|
||||
val PROPERTY_TYPE_MISMATCH_ON_OVERRIDE by error2<FirSourceElement, KtNamedDeclaration, FirMemberDeclaration, FirMemberDeclaration>(SourceElementPositioningStrategies.DECLARATION_RETURN_TYPE)
|
||||
val VAR_TYPE_MISMATCH_ON_OVERRIDE by error2<FirSourceElement, KtNamedDeclaration, FirMemberDeclaration, FirMemberDeclaration>(SourceElementPositioningStrategies.DECLARATION_RETURN_TYPE)
|
||||
@@ -218,7 +235,7 @@ object FirErrors {
|
||||
val MANY_COMPANION_OBJECTS by error0<FirSourceElement, KtObjectDeclaration>(SourceElementPositioningStrategies.COMPANION_OBJECT)
|
||||
val CONFLICTING_OVERLOADS by error1<FirSourceElement, PsiElement, Collection<AbstractFirBasedSymbol<*>>>(SourceElementPositioningStrategies.DECLARATION_SIGNATURE_OR_DEFAULT)
|
||||
val REDECLARATION by error1<FirSourceElement, PsiElement, Collection<AbstractFirBasedSymbol<*>>>()
|
||||
val ANY_METHOD_IMPLEMENTED_IN_INTERFACE by error0<FirSourceElement, PsiElement>()
|
||||
val METHOD_OF_ANY_IMPLEMENTED_IN_INTERFACE by error0<FirSourceElement, PsiElement>()
|
||||
|
||||
// Invalid local declarations
|
||||
val LOCAL_OBJECT_NOT_ALLOWED by error1<FirSourceElement, KtNamedDeclaration, Name>(SourceElementPositioningStrategies.DECLARATION_NAME)
|
||||
@@ -259,6 +276,8 @@ object FirErrors {
|
||||
val EXPECTED_PRIVATE_DECLARATION by error0<FirSourceElement, KtModifierListOwner>(SourceElementPositioningStrategies.VISIBILITY_MODIFIER)
|
||||
val VAL_WITH_SETTER by error0<FirSourceElement, KtPropertyAccessor>()
|
||||
val CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT by error0<FirSourceElement, KtProperty>(SourceElementPositioningStrategies.CONST_MODIFIER)
|
||||
val CONST_VAL_WITH_GETTER by error0<FirSourceElement, KtProperty>()
|
||||
val CONST_VAL_WITH_DELEGATE by error0<FirSourceElement, KtPropertyDelegate>()
|
||||
|
||||
// Multi-platform projects
|
||||
val EXPECTED_DECLARATION_WITH_BODY by error0<FirSourceElement, KtDeclaration>(SourceElementPositioningStrategies.DECLARATION_SIGNATURE)
|
||||
@@ -284,8 +303,8 @@ object FirErrors {
|
||||
// Nullability
|
||||
val UNSAFE_CALL by error1<FirSourceElement, PsiElement, ConeKotlinType>(SourceElementPositioningStrategies.DOT_BY_QUALIFIED)
|
||||
val UNSAFE_IMPLICIT_INVOKE_CALL by error1<FirSourceElement, PsiElement, ConeKotlinType>(SourceElementPositioningStrategies.REFERENCE_BY_QUALIFIED)
|
||||
val UNSAFE_INFIX_CALL by error3<FirSourceElement, KtExpression, FirExpression, String, FirExpression>()
|
||||
val UNSAFE_OPERATOR_CALL by error3<FirSourceElement, KtExpression, FirExpression, String, FirExpression>()
|
||||
val UNSAFE_INFIX_CALL by error3<FirSourceElement, KtExpression, FirExpression, String, FirExpression>(SourceElementPositioningStrategies.REFERENCE_BY_QUALIFIED)
|
||||
val UNSAFE_OPERATOR_CALL by error3<FirSourceElement, KtExpression, FirExpression, String, FirExpression>(SourceElementPositioningStrategies.REFERENCE_BY_QUALIFIED)
|
||||
|
||||
// When expressions
|
||||
val NO_ELSE_IN_WHEN by error1<FirSourceElement, KtWhenExpression, List<WhenMissingCase>>(SourceElementPositioningStrategies.WHEN_EXPRESSION)
|
||||
@@ -298,6 +317,13 @@ object FirErrors {
|
||||
// Function contracts
|
||||
val ERROR_IN_CONTRACT_DESCRIPTION by error1<FirSourceElement, KtElement, String>(SourceElementPositioningStrategies.SELECTOR_BY_QUALIFIED)
|
||||
|
||||
// Conventions
|
||||
val NO_GET_METHOD by error0<FirSourceElement, KtArrayAccessExpression>(SourceElementPositioningStrategies.ARRAY_ACCESS)
|
||||
val NO_SET_METHOD by error0<FirSourceElement, KtArrayAccessExpression>(SourceElementPositioningStrategies.ARRAY_ACCESS)
|
||||
|
||||
// Type alias
|
||||
val TOPLEVEL_TYPEALIASES_ONLY by error0<FirSourceElement, KtTypeAlias>()
|
||||
|
||||
// Extended checkers
|
||||
val REDUNDANT_VISIBILITY_MODIFIER by warning0<FirSourceElement, KtModifierListOwner>(SourceElementPositioningStrategies.VISIBILITY_MODIFIER)
|
||||
val REDUNDANT_MODALITY_MODIFIER by warning0<FirSourceElement, KtModifierListOwner>(SourceElementPositioningStrategies.MODALITY_MODIFIER)
|
||||
|
||||
@@ -21,7 +21,7 @@ class FirCheckersResolveProcessor(
|
||||
session: FirSession,
|
||||
scopeSession: ScopeSession
|
||||
) : FirTransformerBasedResolveProcessor(session, scopeSession) {
|
||||
val diagnosticCollector = FirDiagnosticsCollector.create(session)
|
||||
val diagnosticCollector = FirDiagnosticsCollector.create(session, scopeSession)
|
||||
|
||||
override val transformer: FirTransformer<Nothing?> = FirCheckersRunnerTransformer(diagnosticCollector)
|
||||
}
|
||||
|
||||
@@ -38,3 +38,4 @@ private fun FirLightSourceElement.getChild(types: Set<IElementType>, index: Int,
|
||||
val visitor = LighterTreeElementFinderByType(treeStructure, types, index, depth)
|
||||
return visitor.find(lighterASTNode)?.toFirLightSourceElement(treeStructure)
|
||||
}
|
||||
|
||||
@@ -188,9 +188,27 @@ interface FirDeclarationPresenter {
|
||||
append(']')
|
||||
appendRepresentation(it.symbol.classId)
|
||||
}
|
||||
|
||||
fun represent(it: FirConstructor, owner: FirRegularClass) = buildString {
|
||||
append('<')
|
||||
it.typeParameters.forEach {
|
||||
appendRepresentation(it)
|
||||
append(',')
|
||||
}
|
||||
append('>')
|
||||
append('[')
|
||||
append(']')
|
||||
appendRepresentation(owner.symbol.classId)
|
||||
append('(')
|
||||
it.valueParameters.forEach {
|
||||
appendRepresentation(it)
|
||||
append(',')
|
||||
}
|
||||
append(')')
|
||||
}
|
||||
}
|
||||
|
||||
private class FirDefaultDeclarationPresenter : FirDeclarationPresenter
|
||||
internal class FirDefaultDeclarationPresenter : FirDeclarationPresenter
|
||||
|
||||
private val NO_NAME_PROVIDED = Name.special("<no name provided>")
|
||||
|
||||
@@ -209,49 +227,35 @@ private fun FirDeclaration.isCollectable() = when (this) {
|
||||
/**
|
||||
* Collects FirDeclarations for further analysis.
|
||||
*/
|
||||
class FirDeclarationInspector(
|
||||
private val presenter: FirDeclarationPresenter = FirDefaultDeclarationPresenter()
|
||||
open class FirDeclarationInspector(
|
||||
protected val presenter: FirDeclarationPresenter = FirDefaultDeclarationPresenter()
|
||||
) {
|
||||
val otherDeclarations = mutableMapOf<String, MutableList<FirDeclaration>>()
|
||||
val functionDeclarations = mutableMapOf<String, MutableList<FirSimpleFunction>>()
|
||||
|
||||
fun collect(declaration: FirDeclaration) {
|
||||
if (!declaration.isCollectable()) {
|
||||
return
|
||||
when {
|
||||
!declaration.isCollectable() -> {}
|
||||
declaration is FirSimpleFunction -> collectFunction(presenter.represent(declaration), declaration)
|
||||
declaration is FirRegularClass -> collectNonFunctionDeclaration(presenter.represent(declaration), declaration)
|
||||
declaration is FirTypeAlias -> collectNonFunctionDeclaration(presenter.represent(declaration), declaration)
|
||||
declaration is FirProperty -> collectNonFunctionDeclaration(presenter.represent(declaration), declaration)
|
||||
}
|
||||
|
||||
if (declaration is FirSimpleFunction) {
|
||||
return collectFunction(declaration)
|
||||
}
|
||||
|
||||
val key = when (declaration) {
|
||||
is FirRegularClass -> presenter.represent(declaration)
|
||||
is FirTypeAlias -> presenter.represent(declaration)
|
||||
is FirProperty -> presenter.represent(declaration)
|
||||
else -> return
|
||||
}
|
||||
|
||||
var value = otherDeclarations[key]
|
||||
|
||||
if (value == null) {
|
||||
value = mutableListOf()
|
||||
otherDeclarations[key] = value
|
||||
}
|
||||
|
||||
value.add(declaration)
|
||||
}
|
||||
|
||||
private fun collectFunction(declaration: FirSimpleFunction) {
|
||||
val key = presenter.represent(declaration)
|
||||
var value = functionDeclarations[key]
|
||||
|
||||
if (value == null) {
|
||||
value = mutableListOf()
|
||||
functionDeclarations[key] = value
|
||||
protected open fun collectNonFunctionDeclaration(key: String, declaration: FirDeclaration): MutableList<FirDeclaration> =
|
||||
otherDeclarations.getOrPut(key) {
|
||||
mutableListOf()
|
||||
}.also {
|
||||
it.add(declaration)
|
||||
}
|
||||
|
||||
value.add(declaration)
|
||||
}
|
||||
protected open fun collectFunction(key: String, declaration: FirSimpleFunction): MutableList<FirSimpleFunction> =
|
||||
functionDeclarations.getOrPut(key) {
|
||||
mutableListOf()
|
||||
}.also {
|
||||
it.add(declaration)
|
||||
}
|
||||
|
||||
fun contains(declaration: FirDeclaration) = when (declaration) {
|
||||
is FirSimpleFunction -> presenter.represent(declaration) in functionDeclarations
|
||||
|
||||
@@ -42,6 +42,9 @@ import org.jetbrains.kotlin.psi.KtParameter.VAL_VAR_TOKEN_SET
|
||||
import org.jetbrains.kotlin.psi.psiUtil.visibilityModifierType
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
|
||||
internal fun FirClass<*>.unsubstitutedScope(context: CheckerContext) =
|
||||
this.unsubstitutedScope(context.sessionHolder.session, context.sessionHolder.scopeSession, withForcedTypeCalculator = false)
|
||||
|
||||
/**
|
||||
* Returns true if this is a superclass of other.
|
||||
*/
|
||||
|
||||
@@ -37,7 +37,7 @@ abstract class CheckerContext {
|
||||
|
||||
/**
|
||||
* Returns the closest to the end of context.containingDeclarations
|
||||
* T instance or null if no such item could be found.
|
||||
* instance of type [T] or null if no such item could be found.
|
||||
*/
|
||||
inline fun <reified T : FirDeclaration> findClosest(): T? {
|
||||
for (it in containingDeclarations.asReversed()) {
|
||||
@@ -47,6 +47,18 @@ abstract class CheckerContext {
|
||||
return null
|
||||
}
|
||||
|
||||
/**
|
||||
* Same as the one without specific [check]. For some cases, an instance of type [T] isn't good enough. E.g., property accessor is
|
||||
* either getter or setter, but a type-based search could return, say, the closest setter, while we want to keep searching for a getter.
|
||||
*/
|
||||
inline fun <reified T : FirDeclaration> findClosest(check: (T) -> Boolean): T? {
|
||||
for (it in containingDeclarations.asReversed()) {
|
||||
return (it as? T)?.takeIf(check) ?: continue
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
abstract fun addSuppressedDiagnostics(
|
||||
diagnosticNames: Collection<String>,
|
||||
allInfosSuppressed: Boolean,
|
||||
|
||||
@@ -5,57 +5,289 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir.analysis.checkers.declaration
|
||||
|
||||
import org.jetbrains.kotlin.fir.FirSymbolOwner
|
||||
import org.jetbrains.kotlin.fir.*
|
||||
import org.jetbrains.kotlin.fir.analysis.checkers.FirDeclarationInspector
|
||||
import org.jetbrains.kotlin.fir.analysis.checkers.FirDeclarationPresenter
|
||||
import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext
|
||||
import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter
|
||||
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors
|
||||
import org.jetbrains.kotlin.fir.analysis.diagnostics.reportOn
|
||||
import org.jetbrains.kotlin.fir.declarations.FirDeclaration
|
||||
import org.jetbrains.kotlin.fir.declarations.FirFile
|
||||
import org.jetbrains.kotlin.fir.declarations.FirRegularClass
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.resolve.firProvider
|
||||
import org.jetbrains.kotlin.fir.scopes.PACKAGE_MEMBER
|
||||
import org.jetbrains.kotlin.fir.scopes.impl.FirPackageMemberScope
|
||||
import org.jetbrains.kotlin.fir.symbols.AbstractFirBasedSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol
|
||||
import org.jetbrains.kotlin.fir.visitors.FirVisitorVoid
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.utils.SmartSet
|
||||
|
||||
object FirConflictsChecker : FirBasicDeclarationChecker() {
|
||||
|
||||
private class DeclarationInspector : FirDeclarationInspector() {
|
||||
|
||||
val declarationConflictingSymbols: HashMap<FirDeclaration, SmartSet<AbstractFirBasedSymbol<*>>> = hashMapOf()
|
||||
|
||||
override fun collectNonFunctionDeclaration(key: String, declaration: FirDeclaration): MutableList<FirDeclaration> =
|
||||
super.collectNonFunctionDeclaration(key, declaration).also {
|
||||
collectLocalConflicts(declaration, it)
|
||||
}
|
||||
|
||||
override fun collectFunction(key: String, declaration: FirSimpleFunction): MutableList<FirSimpleFunction> =
|
||||
super.collectFunction(key, declaration).also {
|
||||
collectLocalConflicts(declaration, it)
|
||||
}
|
||||
|
||||
private fun collectLocalConflicts(declaration: FirDeclaration, conflicting: List<FirDeclaration>) {
|
||||
val localConflicts = SmartSet.create<AbstractFirBasedSymbol<*>>()
|
||||
for (otherDeclaration in conflicting) {
|
||||
if (otherDeclaration is FirSymbolOwner<*>) {
|
||||
if (otherDeclaration != declaration && declaration is FirSymbolOwner<*> &&
|
||||
!isExpectAndActual(declaration, otherDeclaration)
|
||||
) {
|
||||
localConflicts.add(otherDeclaration.symbol)
|
||||
declarationConflictingSymbols.getOrPut(otherDeclaration) { SmartSet.create() }.add(declaration.symbol)
|
||||
}
|
||||
}
|
||||
}
|
||||
declarationConflictingSymbols[declaration] = localConflicts
|
||||
}
|
||||
|
||||
private fun isExpectAndActual(declaration1: FirDeclaration, declaration2: FirDeclaration): Boolean {
|
||||
if (declaration1 !is FirMemberDeclaration) return false
|
||||
if (declaration2 !is FirMemberDeclaration) return false
|
||||
return (declaration1.status.isExpect && declaration2.status.isActual) ||
|
||||
(declaration1.status.isActual && declaration2.status.isExpect)
|
||||
}
|
||||
|
||||
private fun areCompatibleMainFunctions(
|
||||
declaration1: FirDeclaration, file1: FirFile, declaration2: FirDeclaration, file2: FirFile?
|
||||
): Boolean {
|
||||
// TODO: proper main function detector
|
||||
if (declaration1 !is FirSimpleFunction || declaration2 !is FirSimpleFunction) return false
|
||||
if (declaration1.name.asString() != "main" || declaration2.name.asString() != "main") return false
|
||||
return file1 != file2
|
||||
}
|
||||
|
||||
private fun collectExternalConflict(
|
||||
declaration: FirDeclaration,
|
||||
declarationPresentation: String,
|
||||
containingFile: FirFile,
|
||||
conflictingSymbol: AbstractFirBasedSymbol<*>,
|
||||
conflictingPresentation: String?,
|
||||
conflictingFile: FirFile?,
|
||||
session: FirSession
|
||||
) {
|
||||
val conflicting = conflictingSymbol.fir as? FirDeclaration ?: return
|
||||
if (declaration.session.moduleInfo != conflicting.session.moduleInfo) return
|
||||
val actualConflictingPresentation = conflictingPresentation ?: presenter.represent(conflicting)
|
||||
if (conflicting == declaration || actualConflictingPresentation != declarationPresentation) return
|
||||
val actualConflictingFile =
|
||||
conflictingFile ?: when (conflictingSymbol) {
|
||||
is FirClassLikeSymbol<*> -> session.firProvider.getFirClassifierContainerFileIfAny(conflictingSymbol)
|
||||
is FirCallableSymbol<*> -> session.firProvider.getFirCallableContainerFile(conflictingSymbol)
|
||||
else -> null
|
||||
}
|
||||
if (containingFile == actualConflictingFile) return // TODO: rewrite local decls checker to the same logic and then remove the check
|
||||
if (areCompatibleMainFunctions(declaration, containingFile, conflicting, actualConflictingFile)) return
|
||||
if (isExpectAndActual(declaration, conflicting)) return
|
||||
if (conflicting is FirMemberDeclaration && !(conflicting is FirSymbolOwner<*> &&
|
||||
session.visibilityChecker.isVisible(conflicting, session, containingFile, emptyList(), null))
|
||||
) {
|
||||
return
|
||||
}
|
||||
declarationConflictingSymbols.getOrPut(declaration) { SmartSet.create() }.add(conflictingSymbol)
|
||||
}
|
||||
|
||||
fun collectWithExternalConflicts(
|
||||
declaration: FirDeclaration,
|
||||
containingFile: FirFile,
|
||||
session: FirSession,
|
||||
packageMemberScope: FirPackageMemberScope
|
||||
) {
|
||||
collect(declaration)
|
||||
var declarationName: Name? = null
|
||||
val declarationPresentation = presenter.represent(declaration) ?: return
|
||||
|
||||
when (declaration) {
|
||||
is FirSimpleFunction -> {
|
||||
declarationName = declaration.name
|
||||
if (!declarationName.isSpecial) {
|
||||
packageMemberScope.processFunctionsByName(declarationName) {
|
||||
collectExternalConflict(
|
||||
declaration, declarationPresentation, containingFile, it, null, null, session
|
||||
)
|
||||
}
|
||||
packageMemberScope.processClassifiersByNameWithSubstitution(declarationName) { symbol, _ ->
|
||||
val classWithSameName = symbol.fir as? FirRegularClass
|
||||
classWithSameName?.onConstructors { constructor ->
|
||||
collectExternalConflict(
|
||||
declaration, declarationPresentation, containingFile,
|
||||
constructor.symbol, presenter.represent(constructor, classWithSameName), null,
|
||||
session
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
is FirVariable<*> -> {
|
||||
declarationName = declaration.name
|
||||
if (!declarationName.isSpecial) {
|
||||
packageMemberScope.processPropertiesByName(declarationName) {
|
||||
collectExternalConflict(
|
||||
declaration, declarationPresentation, containingFile, it, null, null, session
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
is FirRegularClass -> {
|
||||
declarationName = declaration.name
|
||||
|
||||
if (!declarationName.isSpecial) {
|
||||
packageMemberScope.processClassifiersByNameWithSubstitution(declarationName) { symbol, _ ->
|
||||
collectExternalConflict(
|
||||
declaration, declarationPresentation, containingFile, symbol, null, null, session
|
||||
)
|
||||
}
|
||||
declaration.onConstructors { constructor ->
|
||||
packageMemberScope.processFunctionsByName(declarationName!!) {
|
||||
collectExternalConflict(
|
||||
constructor, presenter.represent(constructor, declaration), containingFile,
|
||||
it, null, null, session
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
session.nameConflictsTracker?.let { it as? FirNameConflictsTracker }
|
||||
?.redeclaredClassifiers?.get(declaration.symbol.classId)?.forEach {
|
||||
collectExternalConflict(
|
||||
declaration,
|
||||
declarationPresentation,
|
||||
containingFile,
|
||||
it.classifier,
|
||||
null,
|
||||
it.file,
|
||||
session
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
is FirTypeAlias -> {
|
||||
declarationName = declaration.name
|
||||
if (!declarationName.isSpecial) {
|
||||
packageMemberScope.processClassifiersByNameWithSubstitution(declarationName) { symbol, _ ->
|
||||
collectExternalConflict(
|
||||
declaration, declarationPresentation, containingFile, symbol, null, null, session
|
||||
)
|
||||
}
|
||||
session.nameConflictsTracker?.let { it as? FirNameConflictsTracker }
|
||||
?.redeclaredClassifiers?.get(declaration.symbol.classId)?.forEach {
|
||||
collectExternalConflict(
|
||||
declaration,
|
||||
declarationPresentation,
|
||||
containingFile,
|
||||
it.classifier,
|
||||
null,
|
||||
it.file,
|
||||
session
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (declarationName != null) {
|
||||
session.lookupTracker?.recordLookup(
|
||||
declarationName, containingFile.packageFqName.asString(), declaration.source, containingFile.source
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun check(declaration: FirDeclaration, context: CheckerContext, reporter: DiagnosticReporter) {
|
||||
val inspector = FirDeclarationInspector()
|
||||
val inspector = DeclarationInspector()
|
||||
|
||||
when (declaration) {
|
||||
is FirFile -> checkFile(declaration, inspector)
|
||||
is FirFile -> checkFile(declaration, inspector, context)
|
||||
is FirRegularClass -> checkRegularClass(declaration, inspector)
|
||||
else -> return
|
||||
}
|
||||
|
||||
inspector.functionDeclarations.forEachNonSingle { it, symbols ->
|
||||
reporter.reportOn(it.source, FirErrors.CONFLICTING_OVERLOADS, symbols, context)
|
||||
}
|
||||
|
||||
inspector.otherDeclarations.forEachNonSingle { it, symbols ->
|
||||
reporter.reportOn(it.source, FirErrors.REDECLARATION, symbols, context)
|
||||
}
|
||||
}
|
||||
|
||||
private fun Map<String, List<FirDeclaration>>.forEachNonSingle(action: (FirDeclaration, Collection<AbstractFirBasedSymbol<*>>) -> Unit) {
|
||||
for (value in values) {
|
||||
if (value.size > 1) {
|
||||
val symbols = value.mapNotNull { (it as? FirSymbolOwner<*>)?.symbol }
|
||||
|
||||
value.forEach {
|
||||
action(it, symbols)
|
||||
inspector.declarationConflictingSymbols.forEach { (declaration, symbols) ->
|
||||
when {
|
||||
symbols.isEmpty() -> {}
|
||||
declaration is FirSimpleFunction || declaration is FirConstructor -> {
|
||||
reporter.reportOn(declaration.source, FirErrors.CONFLICTING_OVERLOADS, symbols, context)
|
||||
}
|
||||
else -> {
|
||||
reporter.reportOn(declaration.source, FirErrors.REDECLARATION, symbols, context)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkFile(declaration: FirFile, inspector: FirDeclarationInspector) {
|
||||
for (it in declaration.declarations) {
|
||||
inspector.collect(it)
|
||||
private fun checkFile(file: FirFile, inspector: DeclarationInspector, context: CheckerContext) {
|
||||
val packageMemberScope: FirPackageMemberScope = context.sessionHolder.scopeSession.getOrBuild(file.packageFqName, PACKAGE_MEMBER) {
|
||||
FirPackageMemberScope(file.packageFqName, context.sessionHolder.session)
|
||||
}
|
||||
for (topLevelDeclaration in file.declarations) {
|
||||
inspector.collectWithExternalConflicts(topLevelDeclaration, file, context.session, packageMemberScope)
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkRegularClass(declaration: FirRegularClass, inspector: FirDeclarationInspector) {
|
||||
private fun checkRegularClass(declaration: FirRegularClass, inspector: DeclarationInspector) {
|
||||
for (it in declaration.declarations) {
|
||||
inspector.collect(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun FirDeclarationPresenter.represent(declaration: FirDeclaration): String? =
|
||||
when (declaration) {
|
||||
is FirSimpleFunction -> represent(declaration)
|
||||
is FirRegularClass -> represent(declaration)
|
||||
is FirTypeAlias -> represent(declaration)
|
||||
is FirProperty -> represent(declaration)
|
||||
else -> null
|
||||
}
|
||||
|
||||
class FirNameConflictsTracker : FirNameConflictsTrackerComponent() {
|
||||
|
||||
data class ClassifierWithFile(
|
||||
val classifier: FirClassLikeSymbol<*>,
|
||||
val file: FirFile?
|
||||
)
|
||||
|
||||
val redeclaredClassifiers = HashMap<ClassId, Set<ClassifierWithFile>>()
|
||||
|
||||
override fun registerClassifierRedeclaration(
|
||||
classId: ClassId,
|
||||
newSymbol: FirClassLikeSymbol<*>, newSymbolFile: FirFile,
|
||||
prevSymbol: FirClassLikeSymbol<*>, prevSymbolFile: FirFile?
|
||||
) {
|
||||
redeclaredClassifiers.merge(
|
||||
classId, linkedSetOf(ClassifierWithFile(newSymbol, newSymbolFile), ClassifierWithFile(prevSymbol, prevSymbolFile))
|
||||
) { a, b -> a + b }
|
||||
}
|
||||
}
|
||||
|
||||
private fun FirDeclaration.onConstructors(action: (ctor: FirConstructor) -> Unit) {
|
||||
|
||||
class ClassConstructorVisitor : FirVisitorVoid() {
|
||||
override fun visitElement(element: FirElement) {}
|
||||
|
||||
override fun visitConstructor(constructor: FirConstructor) {
|
||||
action(constructor)
|
||||
}
|
||||
|
||||
override fun visitDeclarationStatus(declarationStatus: FirDeclarationStatus) {}
|
||||
override fun visitRegularClass(regularClass: FirRegularClass) {}
|
||||
override fun visitProperty(property: FirProperty) {}
|
||||
override fun visitSimpleFunction(simpleFunction: FirSimpleFunction) {}
|
||||
}
|
||||
|
||||
acceptChildren(ClassConstructorVisitor())
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
package org.jetbrains.kotlin.fir.analysis.checkers.declaration
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.fir.FirFakeSourceElementKind
|
||||
import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext
|
||||
import org.jetbrains.kotlin.fir.analysis.diagnostics.DiagnosticReporter
|
||||
import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors
|
||||
@@ -31,9 +32,15 @@ object FirConstPropertyChecker : FirPropertyChecker() {
|
||||
reporter.reportOn(declaration.source, FirErrors.CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT, context)
|
||||
}
|
||||
|
||||
if (declaration.getter?.source?.kind !is FirFakeSourceElementKind) {
|
||||
reporter.reportOn(declaration.getter?.source, FirErrors.CONST_VAL_WITH_GETTER, context)
|
||||
}
|
||||
|
||||
if (declaration.delegate != null) {
|
||||
reporter.reportOn(declaration.delegate?.source, FirErrors.CONST_VAL_WITH_DELEGATE, context)
|
||||
}
|
||||
|
||||
// TODO: Implement checkers for these errors (see ConstModifierChecker in FE1.0):
|
||||
// - CONST_VAL_WITH_DELEGATE
|
||||
// - CONST_VAL_WITH_GETTER
|
||||
// - TYPE_CANT_BE_USED_FOR_CONST_VAL
|
||||
// - CONST_VAL_WITHOUT_INITIALIZER
|
||||
// - CONST_VAL_WITH_NON_CONST_INITIALIZER
|
||||
|
||||
@@ -5,11 +5,9 @@
|
||||
|
||||
package org.jetbrains.kotlin.fir.analysis.checkers.declaration
|
||||
|
||||
import org.jetbrains.kotlin.config.LanguageFeature
|
||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.descriptors.Visibilities
|
||||
import org.jetbrains.kotlin.fir.FirElement
|
||||
import org.jetbrains.kotlin.fir.FirSourceElement
|
||||
import org.jetbrains.kotlin.fir.analysis.checkers.context.CheckerContext
|
||||
import org.jetbrains.kotlin.fir.analysis.checkers.modality
|
||||
@@ -18,11 +16,7 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors
|
||||
import org.jetbrains.kotlin.fir.analysis.diagnostics.reportOn
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyAccessor
|
||||
import org.jetbrains.kotlin.fir.expressions.FirVariableAssignment
|
||||
import org.jetbrains.kotlin.fir.languageVersionSettings
|
||||
import org.jetbrains.kotlin.fir.references.FirBackingFieldReference
|
||||
import org.jetbrains.kotlin.fir.types.FirImplicitTypeRef
|
||||
import org.jetbrains.kotlin.fir.visitors.FirVisitorVoid
|
||||
import org.jetbrains.kotlin.lexer.KtTokens
|
||||
|
||||
internal fun isInsideExpectClass(containingClass: FirRegularClass, context: CheckerContext): Boolean {
|
||||
@@ -175,34 +169,6 @@ internal fun checkPropertyAccessors(
|
||||
context: CheckerContext
|
||||
) {
|
||||
if (property.isVal) {
|
||||
if (property.getter != null) {
|
||||
var reassignment: FirBackingFieldReference? = null
|
||||
// TODO: consider replacing this with normal VariableAssignmentChecker and reporting all 'field = ...' in getter (not just 1st)
|
||||
// This way is a bit hacky and does not handle diagnostic suppression normally
|
||||
val visitor = object : FirVisitorVoid() {
|
||||
override fun visitElement(element: FirElement) {
|
||||
element.acceptChildren(this)
|
||||
}
|
||||
|
||||
override fun visitVariableAssignment(variableAssignment: FirVariableAssignment) {
|
||||
// Report the first violation (to match FE 1.0 behavior)
|
||||
if (reassignment != null) return
|
||||
|
||||
val backingFieldReference = variableAssignment.lValue as? FirBackingFieldReference
|
||||
if (backingFieldReference?.resolvedSymbol?.fir == property) {
|
||||
reassignment = backingFieldReference
|
||||
}
|
||||
}
|
||||
}
|
||||
property.getter?.body?.accept(visitor, null)
|
||||
reassignment?.source?.let {
|
||||
if (context.session.languageVersionSettings.supportsFeature(LanguageFeature.RestrictionOfValReassignmentViaBackingField)) {
|
||||
reporter.reportOn(it, FirErrors.VAL_REASSIGNMENT_VIA_BACKING_FIELD_ERROR, property.symbol, context)
|
||||
} else {
|
||||
reporter.reportOn(it, FirErrors.VAL_REASSIGNMENT_VIA_BACKING_FIELD, property.symbol, context)
|
||||
}
|
||||
}
|
||||
}
|
||||
property.setter?.source?.let {
|
||||
reporter.reportOn(it, FirErrors.VAL_WITH_SETTER, context)
|
||||
}
|
||||
@@ -220,3 +186,16 @@ internal fun FirRegularClass.isInlineOrValueClass(): Boolean {
|
||||
|
||||
return isInline || hasModifier(KtTokens.VALUE_KEYWORD)
|
||||
}
|
||||
|
||||
internal val FirMemberDeclaration.isLocalMember: Boolean
|
||||
get() = when (this) {
|
||||
is FirProperty -> this.isLocal
|
||||
is FirRegularClass -> this.isLocal
|
||||
is FirSimpleFunction -> this.isLocal
|
||||
else -> false
|
||||
}
|
||||
|
||||
internal val FirCallableMemberDeclaration<*>.isExtensionMember: Boolean
|
||||
get() {
|
||||
return receiverTypeRef != null && dispatchReceiverType != null
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user