Compare commits

..

38 Commits

Author SHA1 Message Date
Vyacheslav Gerasimov
5724c47bcf Build: Fix uri parsing on windows in publication repo configuration 2020-06-19 00:35:55 +03:00
Ilmir Usmanov
542f1b8709 Minor. Update tests 2020-06-18 17:53:47 +02:00
Ilya Goncharov
932cf21776 [Gradle, JS] Allow to change destDir only for separate task and name it destinationDir
#KT-38331 fixed
2020-06-18 18:51:30 +03:00
Ilya Goncharov
7386408e94 [Gradle, JS] AbstractDukatTask -> DukatTask
#KT-38331 fixed
2020-06-18 18:51:08 +03:00
Ilya Goncharov
49dd839131 [Gradle, JS] DukatTask -> IntegratedDukatTask
#KT-38331 fixed
2020-06-18 18:50:53 +03:00
Ilya Goncharov
46be588f27 [Gradle, JS] Add task for separate usage of Dukat with project npm dependencies
#KT-38331 fixed
2020-06-18 18:50:36 +03:00
Ilya Gorbunov
606fad64ad Leave StringBuilder.append/insert with non-nullable String parameter
Leave these methods as hidden in order to preserve binary compatibility.

#KT-39504
2020-06-18 18:45:43 +03:00
Pavel Kirpichenkov
91b371789e Invalidate library caches on OOCBM with enabled resolution anchors
Without forced clean stale references to declarations from source-dependent libraries
can be accessed after invalidation, i.e. resolved references can point to incorrect PSI.
TBD: more granular invalidation.

KT-24309
2020-06-18 18:27:28 +03:00
Alexander Udalov
204871a7ab Update bootstrap to 1.4.20-dev-772 2020-06-18 16:18:59 +02:00
Ilya Matveev
754a74ac4a [Gradle, native] Allow parallel in-process compiler execution
This commit allows parallel in-process execution of the K/N compiler
that was prohibited by 254a978a06.

Issue #KT-38991 fixed
2020-06-18 14:18:00 +00:00
Ilya Matveev
03bb9138ad [klib] Create ZipFileSystem from a Path instead of an URI
Calling FileSystems.newFileSystem(URI, ...) throws a
FileSystemAlreadyExistsException if a ZipFileSystem for this
URI is already created. We still can use a single instance
of ZipFileSystem by calling FileSystems.getFileSystem. In
this case we use reference counting to determine when this
instance can be safely closed.

But we cannot count references if the same ZipFileSystem is used
from different class loaders. This patch fixes this issue by
creating a file system from Path instead of an URI. Contract of
FileSystemProvider.newFileSystem(Path, ...) doesn't imply throwing
FileSystemAlreadyExistsException.

Issue #KT-37443 fixed
2020-06-18 14:17:59 +00:00
Natalia Selezneva
bf1ad44af9 Run partial import only for specified build root 2020-06-18 17:14:47 +03:00
Natalia Selezneva
5fe47ffbec Workaround for bug in GradleInstallationManager.resolveGradleVersion()
Wrong gradle version when wrapper is used
fixed in 201
2020-06-18 17:14:47 +03:00
Natalia Selezneva
7a47994498 Get gradle version and gradle home from corresponding BuildModel after import
GradleProjectSettings that were used, are updated after KotlinDslListener is called,
so it isn't correct to check if kotlinDslModels are supported using it.
Also GradleScriptDefinitionsContributor should use gradle home from BuildModel, not from settings for the same reasons.

^KT-39104 Fixed
2020-06-18 17:14:46 +03:00
Victor Petukhov
ece61915de NI: clean calls in coroutine inference before the second analysis of += only for right side
^KT-39660 Fixed
2020-06-18 17:09:59 +03:00
Vyacheslav Gerasimov
1f66049a1e Build: Fix plugin marker publication to a remote repository 2020-06-18 16:57:39 +03:00
Igor Chevdar
2fd657b768 [box-tests] Fixed test for K/N 2020-06-18 18:44:11 +05:00
Yan Zhulanow
8b5f2f9474 Fix duplicate stepping filter adding on plugin start-up (KT-38628)
Review KT-CR-1301.
2020-06-18 22:32:34 +09:00
Yan Zhulanow
235b9b9269 Add kotlin-stdlib-js and kotlin-test-js to IDE artifact dependencies 2020-06-18 22:32:34 +09:00
Pavel Kirpichenkov
470fef94fb Use bound resolution facade in DeprecationResolver usages
Resolution facade should be used consistently with direct usages of frontend components.
Otherwise they can start processing descriptors from foreign resolvers which leads to memory leaks.

Plain resolution API with provided facade is not suitable as-is for compiled declarations in KotlinIndicesHelper though.
Resolution facade for module sources contained in helper can't handle decompiled
sources from PSI indices (leads to "ModuleInfo not contained in resolver" errors).
That's why "hacked" resolve via import references should be used there.

#KT-39642 Fixed
2020-06-18 14:24:17 +03:00
Jinseong Jeon
82ef6bf96c FIR2IR: honor user-contributed members in data class if any 2020-06-18 14:23:52 +03:00
Mikhail Glukhikh
b839a91050 Mute 3 FIR BB tests due to LowPriorityInOverloadResolution in reflect
Recently second javaType function appeared in reflect and
now FIR can't correctly resolve the code :(.
Will be fixed after annotation deserialization full support
2020-06-18 13:39:48 +03:00
Mikhail Glukhikh
d009c90e3a Revert "Mute two FIR BB tests due to LowPriorityInOverloadResolution in reflect"
This reverts commit 3768af4f
2020-06-18 13:24:38 +03:00
Mikhail Glukhikh
3768af4f92 Mute two FIR BB tests due to LowPriorityInOverloadResolution in reflect
Recently second javaType function appeared in reflect and
now FIR can't correctly resolve the code :(.
Will be fixed after annotation deserialization full support
2020-06-18 13:21:35 +03:00
Mikhail Zarechenskiy
d44a7ff8f9 Add test for obsolete issue
The issue was fixed in df1595e

 #KT-39630 Fixed
2020-06-18 13:05:42 +03:00
Yan Zhulanow
559561ca6b Add missing intellij-core dependency for sam-with-receiver tests 2020-06-18 19:01:44 +09:00
Yan Zhulanow
713a305f45 Update change data for IrTextTestCaseGenerated
Reason of changes: 098469eb85
2020-06-18 19:01:06 +09:00
Ilya Gorbunov
ec5a04a6c7 Update public jvm API dump after introduction of javaType
See 9e37b62f62
2020-06-18 12:44:23 +03:00
Mikhail Zarechenskiy
a067d138e9 Enable test for new inference after df1595e4
Follow up KT-37149
2020-06-18 12:41:27 +03:00
Mikhail Zarechenskiy
df1595e4bc Fix SAM conversions for derived classes
#KT-39535 Fixed
 #KT-37149 Fixed
2020-06-18 12:36:30 +03:00
Georgy Bronnikov
ee6d432ced Add forgotten test files 2020-06-18 12:22:53 +03:00
Igor Chevdar
cf6eb138ce [box-tests] Turned on a test for JS_IR 2020-06-18 13:17:38 +05:00
Igor Chevdar
2bf73ccfe5 [IR] Supported extension receivers in SAM conversions 2020-06-18 13:17:38 +05:00
Ilya Muradyan
8c2baf0704 Add missing definitelyDoesNotContainName methods 2020-06-18 09:51:16 +02:00
Ilya Muradyan
573c60ed6b Add missing recordLookup implementations 2020-06-18 09:51:16 +02:00
Ilya Muradyan
7526ff9484 Compare lookups without respect to their order 2020-06-18 09:51:16 +02:00
Igor Chevdar
3634ad2d54 Added a test 2020-06-18 12:44:48 +05:00
Igor Chevdar
ecf9727568 [IR] Supported IrEnumEntry
Fixes https://youtrack.jetbrains.com/issue/KT-38996
2020-06-18 12:44:48 +05:00
153 changed files with 2144 additions and 1071 deletions

View File

@@ -804,7 +804,9 @@ tasks {
":kotlin-stdlib-jdk7:publish",
":kotlin-stdlib-jdk8:publish",
":kotlin-reflect:publish",
":kotlin-main-kts:publish"
":kotlin-main-kts:publish",
":kotlin-stdlib-js:publish",
":kotlin-test:kotlin-test-js:publish"
)
}
}

View File

@@ -9,12 +9,16 @@ import org.gradle.api.Project
import org.gradle.api.publish.PublicationContainer
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.publish.maven.tasks.PublishToMavenRepository
import org.gradle.api.tasks.bundling.Jar
import org.gradle.kotlin.dsl.*
import plugins.KotlinBuildPublishingPlugin
import plugins.configureRepository
import java.util.*
internal const val PLUGIN_MARKER_SUFFIX = ".gradle.plugin"
@UseExperimental(ExperimentalStdlibApi::class)
fun Project.publishPluginMarkers(withEmptyJars: Boolean = true) {
val pluginDevelopment = extensions.getByType<PluginBundleExtension>()
val publishingExtension = extensions.getByType<PublishingExtension>()
@@ -25,6 +29,10 @@ fun Project.publishPluginMarkers(withEmptyJars: Boolean = true) {
if (withEmptyJars) {
addEmptyJarArtifacts(markerPublication)
}
tasks.named<PublishToMavenRepository>(
"publish${markerPublication.name.capitalize(Locale.ROOT)}PublicationTo${KotlinBuildPublishingPlugin.REPOSITORY_NAME}Repository"
).configureRepository()
}
}

View File

@@ -15,9 +15,11 @@ import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.publish.maven.plugins.MavenPublishPlugin
import org.gradle.api.publish.maven.tasks.PublishToMavenRepository
import org.gradle.api.tasks.TaskProvider
import org.gradle.kotlin.dsl.*
import org.gradle.plugins.signing.SigningExtension
import org.gradle.plugins.signing.SigningPlugin
import java.net.URI
import java.util.*
import javax.inject.Inject
@@ -119,25 +121,8 @@ class KotlinBuildPublishingPlugin @Inject constructor(
dependsOn(tasks.named("publishToMavenLocal"))
}
tasks.named<PublishToMavenRepository>("publish${PUBLICATION_NAME}PublicationTo${REPOSITORY_NAME}Repository") {
dependsOn(project.rootProject.tasks.named("preparePublication"))
doFirst {
val preparePublication = project.rootProject.tasks.named("preparePublication").get()
val username: String? by preparePublication.extra
val password: String? by preparePublication.extra
val repoUrl: String by preparePublication.extra
repository.apply {
url = uri(repoUrl)
if (url.scheme != "file" && username != null && password != null) {
credentials {
this.username = username
this.password = password
}
}
}
}
}
tasks.named<PublishToMavenRepository>("publish${PUBLICATION_NAME}PublicationTo${REPOSITORY_NAME}Repository")
.configureRepository()
}
companion object {
@@ -152,4 +137,24 @@ class KotlinBuildPublishingPlugin @Inject constructor(
fun humanReadableName(project: Project) =
project.name.split("-").joinToString(separator = " ") { it.capitalize(Locale.ROOT) }
}
}
fun TaskProvider<PublishToMavenRepository>.configureRepository() = configure {
dependsOn(project.rootProject.tasks.named("preparePublication"))
doFirst {
val preparePublication = project.rootProject.tasks.named("preparePublication").get()
val username: String? by preparePublication.extra
val password: String? by preparePublication.extra
val repoUrl: String by preparePublication.extra
repository.apply {
url = project.uri(repoUrl)
if (url.scheme != "file" && username != null && password != null) {
credentials {
this.username = username
this.password = password
}
}
}
}
}

View File

@@ -13661,6 +13661,16 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte
runTest("compiler/testData/diagnostics/tests/j+k/sam/compatibilityResolveToOuterScopeForKotlinFunctions.kt");
}
@TestMetadata("conversionForDerivedGenericClass.kt")
public void testConversionForDerivedGenericClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/sam/conversionForDerivedGenericClass.kt");
}
@TestMetadata("conversionsWithNestedGenerics.kt")
public void testConversionsWithNestedGenerics() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/sam/conversionsWithNestedGenerics.kt");
}
@TestMetadata("enhancedSamConstructor.kt")
public void testEnhancedSamConstructor() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.kt");
@@ -13681,6 +13691,11 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirOldFronte
runTest("compiler/testData/diagnostics/tests/j+k/sam/kt37920.kt");
}
@TestMetadata("kt39630.kt")
public void testKt39630() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/sam/kt39630.kt");
}
@TestMetadata("privateCandidatesWithWrongArguments.kt")
public void testPrivateCandidatesWithWrongArguments() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/sam/privateCandidatesWithWrongArguments.kt");

View File

@@ -144,9 +144,11 @@ internal class ClassMemberGenerator(
val classId = firFunction?.symbol?.callableId?.classId
when {
DataClassMembersGenerator.isComponentN(irFunction) ->
DataClassMembersGenerator(components).generateDataClassComponentBody(irFunction, classId!!)
firFunction?.body?.let { irFunction.body = visitor.convertToIrBlockBody(it) }
?: DataClassMembersGenerator(components).generateDataClassComponentBody(irFunction, classId!!)
DataClassMembersGenerator.isCopy(irFunction) ->
DataClassMembersGenerator(components).generateDataClassCopyBody(irFunction, classId!!)
firFunction?.body?.let { irFunction.body = visitor.convertToIrBlockBody(it) }
?: DataClassMembersGenerator(components).generateDataClassCopyBody(irFunction, classId!!)
else ->
irFunction.body = firFunction?.body?.let { visitor.convertToIrBlockBody(it) }
}

View File

@@ -10375,6 +10375,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/enum/kt2350.kt");
}
@TestMetadata("kt38996.kt")
public void testKt38996() throws Exception {
runTest("compiler/testData/codegen/box/enum/kt38996.kt");
}
@TestMetadata("kt7257.kt")
public void testKt7257() throws Exception {
runTest("compiler/testData/codegen/box/enum/kt7257.kt");
@@ -12404,6 +12409,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
runTest("compiler/testData/codegen/box/inference/lastExpressionOfLambdaWithNothingConstraint.kt");
}
@TestMetadata("plusAssignInsideLambda.kt")
public void testPlusAssignInsideLambda() throws Exception {
runTest("compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt");
}
@TestMetadata("unsafeVarianceCodegen.kt")
public void testUnsafeVarianceCodegen() throws Exception {
runTest("compiler/testData/codegen/box/inference/unsafeVarianceCodegen.kt");

View File

@@ -24,6 +24,8 @@ import java.util.ArrayList
class JavaClassifierTypeImpl(psiClassType: PsiClassType) : JavaTypeImpl<PsiClassType>(psiClassType), JavaClassifierType {
private var resolutionResult: ResolutionResult? = null
override val classifier: JavaClassifierImpl<*>?
get() = resolve().classifier
@@ -63,13 +65,15 @@ class JavaClassifierTypeImpl(psiClassType: PsiClassType) : JavaTypeImpl<PsiClass
)
private fun resolve(): ResolutionResult {
return run {
return resolutionResult ?: run {
val result = psi.resolveGenerics()
val psiClass = result.element
val substitutor = result.substitutor
ResolutionResult(
psiClass?.let { JavaClassifierImpl.create(it) }, substitutor, PsiClassType.isRaw(result)
)
).apply {
resolutionResult = this
}
}
}

View File

@@ -26,6 +26,7 @@ import org.jetbrains.kotlin.resolve.lazy.declarations.ClassMemberDeclarationProv
import org.jetbrains.kotlin.resolve.lazy.declarations.PackageMemberDeclarationProvider
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.utils.addToStdlib.firstNotNullResult
import org.jetbrains.kotlin.utils.addToStdlib.flatMapToNullable
import java.util.*
//----------------------------------------------------------------
@@ -43,6 +44,13 @@ interface SyntheticResolveExtension {
override fun getSyntheticNestedClassNames(thisDescriptor: ClassDescriptor): List<Name> =
instances.flatMap { withLinkageErrorLogger(it) { getSyntheticNestedClassNames(thisDescriptor) } }
override fun getPossibleSyntheticNestedClassNames(thisDescriptor: ClassDescriptor): List<Name>? =
instances.flatMapToNullable(ArrayList<Name>()) {
withLinkageErrorLogger(it) {
getPossibleSyntheticNestedClassNames(thisDescriptor)
}
}
override fun getSyntheticFunctionNames(thisDescriptor: ClassDescriptor): List<Name> =
instances.flatMap { withLinkageErrorLogger(it) { getSyntheticFunctionNames(thisDescriptor) } }
@@ -136,6 +144,13 @@ interface SyntheticResolveExtension {
fun getSyntheticNestedClassNames(thisDescriptor: ClassDescriptor): List<Name> = emptyList()
/**
* This method should return either superset of what [getSyntheticNestedClassNames] returns,
* or null in case it needs to run resolution and inference and/or it is very costly.
* Override this method if resolution started to fail with recursion.
*/
fun getPossibleSyntheticNestedClassNames(thisDescriptor: ClassDescriptor): List<Name>? = getSyntheticNestedClassNames(thisDescriptor)
fun addSyntheticSupertypes(thisDescriptor: ClassDescriptor, supertypes: MutableList<KotlinType>) {}
fun generateSyntheticClasses(

View File

@@ -44,6 +44,7 @@ import org.jetbrains.kotlin.storage.getValue
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.checker.KotlinTypeRefiner
import org.jetbrains.kotlin.types.refinement.TypeRefinement
import org.jetbrains.kotlin.utils.addToStdlib.flatMapToNullable
import java.util.*
open class LazyClassMemberScope(
@@ -102,7 +103,7 @@ open class LazyClassMemberScope(
}
private val _variableNames: MutableSet<Name>
by lazy(LazyThreadSafetyMode.PUBLICATION) {
by storageManager.createLazyValue {
mutableSetOf<Name>().apply {
addAll(declarationProvider.getDeclarationNames())
supertypes.flatMapTo(this) {
@@ -112,9 +113,10 @@ open class LazyClassMemberScope(
}
private val _functionNames: MutableSet<Name>
by lazy(LazyThreadSafetyMode.PUBLICATION) {
by storageManager.createLazyValue {
mutableSetOf<Name>().apply {
addAll(declarationProvider.getDeclarationNames())
addAll(c.syntheticResolveExtension.getSyntheticFunctionNames(thisDescriptor))
supertypes.flatMapTo(this) {
it.memberScope.getFunctionNames()
}
@@ -123,6 +125,32 @@ open class LazyClassMemberScope(
}
}
private val _classifierNames: Set<Name>?
by storageManager.createNullableLazyValue {
mutableSetOf<Name>().apply {
supertypes.flatMapToNullable(this) {
it.memberScope.getClassifierNames()
} ?: return@createNullableLazyValue null
addAll(declarationProvider.getDeclarationNames())
with(c.syntheticResolveExtension) {
getPossibleSyntheticNestedClassNames(thisDescriptor)?.let { addAll(it) } ?: return@createNullableLazyValue null
getSyntheticCompanionObjectNameIfNeeded(thisDescriptor)?.let { add(it) }
}
}
}
private val _allNames: Set<Name>?
by storageManager.createNullableLazyValue {
val classifiers = getClassifierNames() ?: return@createNullableLazyValue null
mutableSetOf<Name>().apply {
addAll(getVariableNames())
addAll(getFunctionNames())
addAll(classifiers)
}
}
private fun getDataClassRelatedFunctionNames(): Collection<Name> {
val declarations = mutableListOf<DeclarationDescriptor>()
addDataClassMethods(declarations, NoLookupLocation.WHEN_GET_ALL_DESCRIPTORS)
@@ -131,6 +159,11 @@ open class LazyClassMemberScope(
override fun getVariableNames() = _variableNames
override fun getFunctionNames() = _functionNames
override fun getClassifierNames() = _classifierNames
override fun definitelyDoesNotContainName(name: Name): Boolean {
return _allNames?.let { name !in it } ?: false
}
private interface MemberExtractor<out T : CallableMemberDescriptor> {
fun extract(extractFrom: KotlinType, name: Name): Collection<T>

View File

@@ -248,7 +248,7 @@ public class ExpressionTypingVisitorForStatements extends ExpressionTypingVisito
// Check for '+'
// We should clear calls info for coroutine inference within right side as here we analyze it a second time in another context
if (context.inferenceSession instanceof CoroutineInferenceSession) {
((CoroutineInferenceSession) context.inferenceSession).clearCallsInfoByContainingElement(expression);
((CoroutineInferenceSession) context.inferenceSession).clearCallsInfoByContainingElement(right);
}
Name counterpartName = OperatorConventions.BINARY_OPERATION_NAMES.get(OperatorConventions.ASSIGNMENT_OPERATION_COUNTERPARTS.get(operationType));
binaryOperationDescriptors = components.callResolver.resolveBinaryCall(

View File

@@ -158,6 +158,12 @@ open class IrBuildingTransformer(private val context: BackendContext) : IrElemen
return super.visitAnonymousInitializer(declaration)
}
}
override fun visitEnumEntry(declaration: IrEnumEntry): IrStatement {
withBuilder(declaration.symbol) {
return super.visitEnumEntry(declaration)
}
}
}
@OptIn(ObsoleteDescriptorBasedAPI::class)

View File

@@ -147,13 +147,14 @@ abstract class SingleAbstractMethodLowering(val context: CommonBackendContext) :
val inlinePrefix = if (wrapperVisibility == Visibilities.PUBLIC) "\$i" else ""
val wrapperName = Name.identifier("sam$inlinePrefix\$$superFqName$SAM_WRAPPER_SUFFIX")
val superMethod = superClass.functions.single { it.modality == Modality.ABSTRACT }
val extensionReceiversCount = if (superMethod.extensionReceiverParameter == null) 0 else 1
// TODO: have psi2ir cast the argument to the correct function type. Also see the TODO
// about type parameters in `visitTypeOperator`.
val wrappedFunctionClass =
if (superMethod.isSuspend)
context.ir.symbols.suspendFunctionN(superMethod.valueParameters.size).owner
context.ir.symbols.suspendFunctionN(superMethod.valueParameters.size + extensionReceiversCount).owner
else
context.ir.symbols.functionN(superMethod.valueParameters.size).owner
context.ir.symbols.functionN(superMethod.valueParameters.size + extensionReceiversCount).owner
val wrappedFunctionType = wrappedFunctionClass.defaultType
val subclass = buildClass {
@@ -204,11 +205,13 @@ abstract class SingleAbstractMethodLowering(val context: CommonBackendContext) :
}.apply {
overriddenSymbols = listOf(superMethod.symbol)
dispatchReceiverParameter = subclass.thisReceiver!!.copyTo(this)
extensionReceiverParameter = superMethod.extensionReceiverParameter?.copyTo(this)
valueParameters = superMethod.valueParameters.map { it.copyTo(this) }
body = context.createIrBuilder(symbol).irBlockBody {
+irReturn(irCall(wrappedFunctionClass.functions.single { it.name == OperatorNameConventions.INVOKE }).apply {
dispatchReceiver = irGetField(irGet(dispatchReceiverParameter!!), field)
valueParameters.forEachIndexed { i, parameter -> putValueArgument(i, irGet(parameter)) }
extensionReceiverParameter?.let { putValueArgument(0, irGet(it)) }
valueParameters.forEachIndexed { i, parameter -> putValueArgument(extensionReceiversCount + i, irGet(parameter)) }
})
}
}

View File

@@ -64,19 +64,22 @@ object SamTypeConversions : ParameterTypeConversion {
val callComponents = candidate.callComponents
val originalExpectedType = argument.getExpectedType(parameter.original, callComponents.languageVersionSettings)
val convertedTypeByOriginal =
callComponents.samConversionResolver.getFunctionTypeForPossibleSamType(
originalExpectedType,
callComponents.samConversionOracle
) ?: return null
val convertedTypeByCandidate =
callComponents.samConversionResolver.getFunctionTypeForPossibleSamType(
expectedParameterType,
callComponents.samConversionOracle
)
) ?: return null
assert(expectedParameterType.constructor == originalExpectedType.constructor && convertedTypeByCandidate != null) {
val convertedTypeByOriginal =
if (expectedParameterType.constructor == originalExpectedType.constructor)
callComponents.samConversionResolver.getFunctionTypeForPossibleSamType(
originalExpectedType,
callComponents.samConversionOracle
)
else
convertedTypeByCandidate
assert(convertedTypeByCandidate.constructor == convertedTypeByOriginal?.constructor) {
"If original type is SAM type, then candidate should have same type constructor and corresponding function type\n" +
"originalExpectType: $originalExpectedType, candidateExpectType: $expectedParameterType\n" +
"functionTypeByOriginal: $convertedTypeByOriginal, functionTypeByCandidate: $convertedTypeByCandidate"
@@ -84,7 +87,7 @@ object SamTypeConversions : ParameterTypeConversion {
candidate.resolvedCall.registerArgumentWithSamConversion(
argument,
SamConversionDescription(convertedTypeByOriginal, convertedTypeByCandidate!!)
SamConversionDescription(convertedTypeByOriginal!!, convertedTypeByCandidate)
)
if (needCompatibilityResolveForSAM(candidate, expectedParameterType)) {

View File

@@ -91,6 +91,14 @@ class LexicalChainedScope private constructor(
p.println("}")
}
override fun definitelyDoesNotContainName(name: Name): Boolean {
return memberScopes.all { it.definitelyDoesNotContainName(name) }
}
override fun recordLookup(name: Name, location: LookupLocation) {
memberScopes.forEach { it.recordLookup(name, location) }
}
companion object {
@JvmOverloads

View File

@@ -39,7 +39,8 @@ fun box(): String {
receiver = { invokeOrder += " receiver"; "R" }()
)
if (result != "C, R, I") return "fail 3: $result"
if (invokeOrder != "init constraints receiver") return "fail 4: $invokeOrder"
// Change test after e3fe1bcf7c3 has been dealt with.
if (invokeOrder != "init receiver constraints") return "fail 4: $invokeOrder"
result = ""
invokeOrder = ""

View File

@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// WITH_COROUTINES
// COMMON_COROUTINES_TEST

View File

@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// WITH_COROUTINES
// COMMON_COROUTINES_TEST

View File

@@ -0,0 +1,5 @@
enum class E(val b: Boolean) {
TRUE(1 == 1)
}
fun box() = if (E.TRUE.b) "OK" else "fail"

View File

@@ -1,6 +1,6 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND: JS_IR_ES6
// SKIP_DCE_DRIVEN
fun interface FunWithReceiver {
fun String.foo(): String

View File

@@ -0,0 +1,22 @@
// WITH_RUNTIME
import kotlin.experimental.ExperimentalTypeInference
interface SendChannel<in T> {
suspend fun send(value: T)
}
@OptIn(ExperimentalTypeInference::class)
public fun <T> flux(@BuilderInference block: suspend SendChannel<T>.() -> Unit) {}
suspend inline fun <T> T.collect(action: (T) -> Unit) { action(this) }
fun test() {
flux {
var result = ""
"OK".collect { result += it }
send(result)
}
}
fun box() = "OK"

View File

@@ -1,5 +1,3 @@
// TODO: new inference doesn't do SAM conversion in this case. KT-37149
// !LANGUAGE: -NewInference
// TARGET_BACKEND: JVM
// IGNORE_BACKEND_FIR: JVM_IR
// FILE: Generic.java

View File

@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TODO: investigate should it be ran for JS or not
// TARGET_BACKEND: JVM

View File

@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// WITH_REFLECT

View File

@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TODO: investigate should it be ran for JS or not
// TARGET_BACKEND: JVM

View File

@@ -0,0 +1,23 @@
// FILE: Java1.java
public class Java1 {
public int f;
}
// FILE: Java2.java
public class Java2 extends Kotlin1 {
}
// FILE: test.kt
open class Kotlin1 : Java1()
open class Kotlin2 : Java2() {
fun getF() = super.f
}
fun test1(j: Kotlin2) = j.f
// @Kotlin2.class:
// 1 GETFIELD Java2.f : I
// @TestKt.class:
// 1 GETFIELD Kotlin2.f : I

View File

@@ -0,0 +1,39 @@
// !LANGUAGE: +NewInference
// (old inference fails in the frontend)
// FILE: JFieldOwner.java
public class JFieldOwner {
public int f;
}
// FILE: test.kt
interface IFoo
class Derived1 : JFieldOwner(), IFoo
class Derived2 : JFieldOwner(), IFoo
open class Mid : JFieldOwner()
class DerivedThroughMid1 : Mid(), IFoo
class DerivedThroughMid2 : Mid(), IFoo
fun test(b : Boolean) {
val d1 = Derived1()
val d2 = Derived2()
val k = if (b) d1 else d2
k.f = 42
k.f
val md1 = DerivedThroughMid1()
val md2 = DerivedThroughMid2()
val mk = if (b) md1 else md2
mk.f = 44
mk.f
}
// @TestKt.class:
// 1 GETFIELD JFieldOwner.f : I
// 1 PUTFIELD JFieldOwner.f : I
// 1 GETFIELD Mid.f : I
// 1 PUTFIELD Mid.f : I

View File

@@ -0,0 +1,22 @@
// FILE: A.java
public interface A<T> {
void f(T arg);
}
// FILE: B.java
public interface B extends A<Runnable> {}
// FILE: C.java
public class C<K> {
public void f(K k) {}
public static <R> void g(R r) {}
}
// FILE: test.kt
fun test(a: A<Runnable>, b: B, c: C<Runnable>) {
a.f { }
b.f { }
c.f { }
C<Runnable>().f { }
C.g<Runnable> { }
}

View File

@@ -0,0 +1,22 @@
// FILE: A.java
public interface A<T> {
void f(T arg);
}
// FILE: B.java
public interface B extends A<Runnable> {}
// FILE: C.java
public class C<K> {
public void f(K k) {}
public static <R> void g(R r) {}
}
// FILE: test.kt
fun test(a: A<Runnable>, b: B, c: C<Runnable>) {
a.f { }
b.f { }
c.f { }
C<Runnable>().f { }
C.g<Runnable> <!TYPE_MISMATCH, TYPE_MISMATCH!>{ }<!>
}

View File

@@ -0,0 +1,28 @@
package
public fun test(/*0*/ a: A<java.lang.Runnable>, /*1*/ b: B, /*2*/ c: C<java.lang.Runnable>): kotlin.Unit
public interface A</*0*/ T : kotlin.Any!> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract fun f(/*0*/ arg: T!): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface B : A<java.lang.Runnable!> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ /*fake_override*/ fun f(/*0*/ arg: java.lang.Runnable!): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public open class C</*0*/ K : kotlin.Any!> {
public constructor C</*0*/ K : kotlin.Any!>()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open fun f(/*0*/ k: K!): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
// Static members
public open fun </*0*/ R : kotlin.Any!> g(/*0*/ r: R!): kotlin.Unit
}

View File

@@ -0,0 +1,22 @@
// FIR_IDENTICAL
// FILE: Listener.java
public interface Listener<T> {
void on(T self);
}
// FILE: Base.java
public class Base<S, T extends Listener<S>> {
public void addListener(T listener) {}
}
// FILE: Derived.java
public class Derived extends Base<Derived, Listener<Derived>> {}
// FILE: test.kt
fun test(w: Derived) {
w.addListener { _ -> call() }
}
fun call() {}

View File

@@ -0,0 +1,27 @@
package
public fun call(): kotlin.Unit
public fun test(/*0*/ w: Derived): kotlin.Unit
public open class Base</*0*/ S : kotlin.Any!, /*1*/ T : Listener<S!>!> {
public constructor Base</*0*/ S : kotlin.Any!, /*1*/ T : Listener<S!>!>()
public open fun addListener(/*0*/ listener: T!): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public open class Derived : Base<Derived!, Listener<Derived!>!> {
public constructor Derived()
public open override /*1*/ /*fake_override*/ fun addListener(/*0*/ listener: Listener<Derived!>!): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface Listener</*0*/ T : kotlin.Any!> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public abstract fun on(/*0*/ self: T!): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}

View File

@@ -0,0 +1,14 @@
// FIR_IDENTICAL
// FILE: A.java
public class A<T> {
public void add(T x) {}
public static class B extends A<Runnable> {}
}
// FILE: test.kt
fun test(x: A.B) {
x.add { }
}

View File

@@ -0,0 +1,19 @@
package
public fun test(/*0*/ x: A.B): kotlin.Unit
public open class A</*0*/ T : kotlin.Any!> {
public constructor A</*0*/ T : kotlin.Any!>()
public open fun add(/*0*/ x: T!): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
public open class B : A<java.lang.Runnable!> {
public constructor B()
public open override /*1*/ /*fake_override*/ fun add(/*0*/ x: java.lang.Runnable!): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}

View File

@@ -1,18 +0,0 @@
// !LANGUAGE: +NewInference
// FILE: J.java
public interface J<T> {
public void foo(T r1, T r2);
}
// FILE: Runnable.java
public interface Runnable {
void run();
}
// FILE: 1.kt
fun test(j: J<Runnable>, r: Runnable) {
j.foo(r, r)
j.foo(r, {})
j.foo({}, r)
j.foo({}, {})
}

View File

@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +NewInference
// FILE: J.java
public interface J<T> {
@@ -12,7 +13,7 @@ public interface Runnable {
// FILE: 1.kt
fun test(j: J<Runnable>, r: Runnable) {
j.foo(r, r)
j.foo(r, <!TYPE_MISMATCH!>{}<!>)
j.foo(<!TYPE_MISMATCH!>{}<!>, r)
j.foo(<!TYPE_MISMATCH!>{}<!>, <!TYPE_MISMATCH!>{}<!>)
j.foo(r, {})
j.foo({}, r)
j.foo({}, {})
}

View File

@@ -1,17 +0,0 @@
// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions
// FILE: Runnable.java
public interface Runnable {
void run();
}
// FILE: 1.kt
interface K<T> {
fun foo(t1: T, t2: T)
}
fun test(k: K<Runnable>, r: Runnable) {
k.foo(r, r)
k.foo(r, {})
k.foo({}, r)
k.foo({}, {})
}

View File

@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions
// FILE: Runnable.java
public interface Runnable {
@@ -11,7 +12,7 @@ interface K<T> {
fun test(k: K<Runnable>, r: Runnable) {
k.foo(r, r)
k.foo(r, <!TYPE_MISMATCH!>{}<!>)
k.foo(<!TYPE_MISMATCH!>{}<!>, r)
k.foo(<!TYPE_MISMATCH!>{}<!>, <!TYPE_MISMATCH!>{}<!>)
k.foo(r, {})
k.foo({}, r)
k.foo({}, {})
}

View File

@@ -9,28 +9,28 @@ CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:J1 modality:OPEN visibility:public
CONSTRUCTOR IR_EXTERNAL_DECLARATION_STUB visibility:public <Y2> ($this:<root>.J1<X1 of <root>.J1>) returnType:<root>.J1.J2<X2 of <root>.J1.J2, X1 of <root>.J1>
TYPE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:Y2 index:1 variance: superTypes:[<unbound IrClassPublicSymbolImpl>?]
$outer: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:<root>.J1<X1 of <root>.J1>
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:<unbound IrClassPublicSymbolImpl>) returnType:<unbound IrClassPublicSymbolImpl> [fake_override]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:<unbound IrClassPublicSymbolImpl>, other:<unbound IrClassPublicSymbolImpl>?) returnType:<unbound IrClassPublicSymbolImpl> [fake_override,operator]
overridden:
public open fun equals (other: <unbound IrClassPublicSymbolImpl>?): <unbound IrClassPublicSymbolImpl> [operator] declared in kotlin.Any
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.Any
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:<unbound IrClassPublicSymbolImpl> [fake_override]
overridden:
public open fun hashCode (): <unbound IrClassPublicSymbolImpl> declared in kotlin.Any
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:<unbound IrClassPublicSymbolImpl> [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): <unbound IrClassPublicSymbolImpl> [operator] declared in kotlin.Any
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.Any
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:<unbound IrClassPublicSymbolImpl> [fake_override]
overridden:
public open fun toString (): <unbound IrClassPublicSymbolImpl> declared in kotlin.Any
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:<unbound IrClassPublicSymbolImpl> [fake_override]
overridden:
public open fun hashCode (): <unbound IrClassPublicSymbolImpl> declared in kotlin.Any
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:<unbound IrClassPublicSymbolImpl> [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): <unbound IrClassPublicSymbolImpl> [operator] declared in kotlin.Any
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.Any
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:<unbound IrClassPublicSymbolImpl> [fake_override]
overridden:
public open fun hashCode (): <unbound IrClassPublicSymbolImpl> declared in kotlin.Any
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:<unbound IrClassPublicSymbolImpl> [fake_override]
overridden:
public open fun toString (): <unbound IrClassPublicSymbolImpl> declared in kotlin.Any

View File

@@ -0,0 +1,32 @@
// !LANGUAGE: +NewInference
// (old inference fails in the frontend)
// FILE: JFieldOwner.java
public class JFieldOwner {
public int f;
}
// FILE: jvmFieldWithIntersectionTypes.kt
interface IFoo
class Derived1 : JFieldOwner(), IFoo
class Derived2 : JFieldOwner(), IFoo
open class Mid : JFieldOwner()
class DerivedThroughMid1 : Mid(), IFoo
class DerivedThroughMid2 : Mid(), IFoo
fun test(b : Boolean) {
val d1 = Derived1()
val d2 = Derived2()
val k = if (b) d1 else d2
k.f = 42
k.f
val md1 = DerivedThroughMid1()
val md2 = DerivedThroughMid2()
val mk = if (b) md1 else md2
mk.f = 44
mk.f
}

View File

@@ -0,0 +1,148 @@
FILE fqName:<root> fileName:/jvmFieldWithIntersectionTypes.kt
CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.IFoo
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[<root>.JFieldOwner; <root>.IFoo]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Derived1
CONSTRUCTOR visibility:public <> () returnType:<root>.Derived1 [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.JFieldOwner'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[<root>.JFieldOwner; <root>.IFoo]'
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:Derived2 modality:FINAL visibility:public superTypes:[<root>.JFieldOwner; <root>.IFoo]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Derived2
CONSTRUCTOR visibility:public <> () returnType:<root>.Derived2 [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.JFieldOwner'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived2 modality:FINAL visibility:public superTypes:[<root>.JFieldOwner; <root>.IFoo]'
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:Mid modality:OPEN visibility:public superTypes:[<root>.JFieldOwner]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Mid
CONSTRUCTOR visibility:public <> () returnType:<root>.Mid [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.JFieldOwner'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Mid modality:OPEN visibility:public superTypes:[<root>.JFieldOwner]'
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:DerivedThroughMid1 modality:FINAL visibility:public superTypes:[<root>.Mid; <root>.IFoo]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.DerivedThroughMid1
CONSTRUCTOR visibility:public <> () returnType:<root>.DerivedThroughMid1 [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Mid'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DerivedThroughMid1 modality:FINAL visibility:public superTypes:[<root>.Mid; <root>.IFoo]'
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:DerivedThroughMid2 modality:FINAL visibility:public superTypes:[<root>.Mid; <root>.IFoo]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.DerivedThroughMid2
CONSTRUCTOR visibility:public <> () returnType:<root>.DerivedThroughMid2 [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Mid'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DerivedThroughMid2 modality:FINAL visibility:public superTypes:[<root>.Mid; <root>.IFoo]'
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:test visibility:public modality:FINAL <> (b:kotlin.Boolean) returnType:kotlin.Unit
VALUE_PARAMETER name:b index:0 type:kotlin.Boolean
BLOCK_BODY
VAR name:d1 type:<root>.Derived1 [val]
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Derived1' type=<root>.Derived1 origin=null
VAR name:d2 type:<root>.Derived2 [val]
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Derived2' type=<root>.Derived2 origin=null
VAR name:k type:<root>.JFieldOwner [val]
WHEN type=<root>.JFieldOwner origin=IF
BRANCH
if: GET_VAR 'b: kotlin.Boolean declared in <root>.test' type=kotlin.Boolean origin=null
then: GET_VAR 'val d1: <root>.Derived1 [val] declared in <root>.test' type=<root>.Derived1 origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: GET_VAR 'val d2: <root>.Derived2 [val] declared in <root>.test' type=<root>.Derived2 origin=null
SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:f type:kotlin.Int visibility:public' type=kotlin.Unit origin=EQ
receiver: GET_VAR 'val k: <root>.JFieldOwner [val] declared in <root>.test' type=<root>.JFieldOwner origin=null
value: CONST Int type=kotlin.Int value=42
GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:f type:kotlin.Int visibility:public' type=kotlin.Int origin=GET_PROPERTY
receiver: GET_VAR 'val k: <root>.JFieldOwner [val] declared in <root>.test' type=<root>.JFieldOwner origin=null
VAR name:md1 type:<root>.DerivedThroughMid1 [val]
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.DerivedThroughMid1' type=<root>.DerivedThroughMid1 origin=null
VAR name:md2 type:<root>.DerivedThroughMid2 [val]
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.DerivedThroughMid2' type=<root>.DerivedThroughMid2 origin=null
VAR name:mk type:<root>.Mid [val]
WHEN type=<root>.Mid origin=IF
BRANCH
if: GET_VAR 'b: kotlin.Boolean declared in <root>.test' type=kotlin.Boolean origin=null
then: GET_VAR 'val md1: <root>.DerivedThroughMid1 [val] declared in <root>.test' type=<root>.DerivedThroughMid1 origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: GET_VAR 'val md2: <root>.DerivedThroughMid2 [val] declared in <root>.test' type=<root>.DerivedThroughMid2 origin=null
SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:f type:kotlin.Int visibility:public' type=kotlin.Unit origin=EQ
receiver: GET_VAR 'val mk: <root>.Mid [val] declared in <root>.test' type=<root>.Mid origin=null
value: CONST Int type=kotlin.Int value=44
GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:f type:kotlin.Int visibility:public' type=kotlin.Int origin=GET_PROPERTY
receiver: GET_VAR 'val mk: <root>.Mid [val] declared in <root>.test' type=<root>.Mid origin=null

View File

@@ -0,0 +1,171 @@
FILE fqName:<root> fileName:/jvmFieldWithIntersectionTypes.kt
CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.IFoo
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[<root>.JFieldOwner; <root>.IFoo]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Derived1
CONSTRUCTOR visibility:public <> () returnType:<root>.Derived1 [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.JFieldOwner'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[<root>.JFieldOwner; <root>.IFoo]'
PROPERTY FAKE_OVERRIDE name:f visibility:public modality:FINAL [fake_override,var]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in <root>.JFieldOwner
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in <root>.IFoo
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int [fake_override] declared in <root>.JFieldOwner
public open fun hashCode (): kotlin.Int [fake_override] declared in <root>.IFoo
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String [fake_override] declared in <root>.JFieldOwner
public open fun toString (): kotlin.String [fake_override] declared in <root>.IFoo
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:Derived2 modality:FINAL visibility:public superTypes:[<root>.JFieldOwner; <root>.IFoo]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Derived2
CONSTRUCTOR visibility:public <> () returnType:<root>.Derived2 [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.JFieldOwner'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived2 modality:FINAL visibility:public superTypes:[<root>.JFieldOwner; <root>.IFoo]'
PROPERTY FAKE_OVERRIDE name:f visibility:public modality:FINAL [fake_override,var]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in <root>.JFieldOwner
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in <root>.IFoo
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int [fake_override] declared in <root>.JFieldOwner
public open fun hashCode (): kotlin.Int [fake_override] declared in <root>.IFoo
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String [fake_override] declared in <root>.JFieldOwner
public open fun toString (): kotlin.String [fake_override] declared in <root>.IFoo
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:Mid modality:OPEN visibility:public superTypes:[<root>.JFieldOwner]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Mid
CONSTRUCTOR visibility:public <> () returnType:<root>.Mid [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.JFieldOwner'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Mid modality:OPEN visibility:public superTypes:[<root>.JFieldOwner]'
PROPERTY FAKE_OVERRIDE name:f visibility:public modality:FINAL [fake_override,var]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in <root>.JFieldOwner
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int [fake_override] declared in <root>.JFieldOwner
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String [fake_override] declared in <root>.JFieldOwner
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:DerivedThroughMid1 modality:FINAL visibility:public superTypes:[<root>.Mid; <root>.IFoo]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.DerivedThroughMid1
CONSTRUCTOR visibility:public <> () returnType:<root>.DerivedThroughMid1 [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Mid'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DerivedThroughMid1 modality:FINAL visibility:public superTypes:[<root>.Mid; <root>.IFoo]'
PROPERTY FAKE_OVERRIDE name:f visibility:public modality:FINAL [fake_override,var]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in <root>.Mid
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in <root>.IFoo
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int [fake_override] declared in <root>.Mid
public open fun hashCode (): kotlin.Int [fake_override] declared in <root>.IFoo
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String [fake_override] declared in <root>.Mid
public open fun toString (): kotlin.String [fake_override] declared in <root>.IFoo
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:DerivedThroughMid2 modality:FINAL visibility:public superTypes:[<root>.Mid; <root>.IFoo]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.DerivedThroughMid2
CONSTRUCTOR visibility:public <> () returnType:<root>.DerivedThroughMid2 [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Mid'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DerivedThroughMid2 modality:FINAL visibility:public superTypes:[<root>.Mid; <root>.IFoo]'
PROPERTY FAKE_OVERRIDE name:f visibility:public modality:FINAL [fake_override,var]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in <root>.Mid
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in <root>.IFoo
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int [fake_override] declared in <root>.Mid
public open fun hashCode (): kotlin.Int [fake_override] declared in <root>.IFoo
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String [fake_override] declared in <root>.Mid
public open fun toString (): kotlin.String [fake_override] declared in <root>.IFoo
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN name:test visibility:public modality:FINAL <> (b:kotlin.Boolean) returnType:kotlin.Unit
VALUE_PARAMETER name:b index:0 type:kotlin.Boolean
BLOCK_BODY
VAR name:d1 type:<root>.Derived1 [val]
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Derived1' type=<root>.Derived1 origin=null
VAR name:d2 type:<root>.Derived2 [val]
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.Derived2' type=<root>.Derived2 origin=null
VAR name:k type:kotlin.Any [val]
WHEN type=kotlin.Any origin=IF
BRANCH
if: GET_VAR 'b: kotlin.Boolean declared in <root>.test' type=kotlin.Boolean origin=null
then: GET_VAR 'val d1: <root>.Derived1 [val] declared in <root>.test' type=<root>.Derived1 origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: GET_VAR 'val d2: <root>.Derived2 [val] declared in <root>.test' type=<root>.Derived2 origin=null
SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:f type:kotlin.Int visibility:public' type=kotlin.Unit origin=EQ
receiver: TYPE_OP type=<root>.JFieldOwner origin=IMPLICIT_CAST typeOperand=<root>.JFieldOwner
GET_VAR 'val k: kotlin.Any [val] declared in <root>.test' type=kotlin.Any origin=null
value: CONST Int type=kotlin.Int value=42
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:f type:kotlin.Int visibility:public' type=kotlin.Int origin=GET_PROPERTY
receiver: TYPE_OP type=<root>.JFieldOwner origin=IMPLICIT_CAST typeOperand=<root>.JFieldOwner
GET_VAR 'val k: kotlin.Any [val] declared in <root>.test' type=kotlin.Any origin=null
VAR name:md1 type:<root>.DerivedThroughMid1 [val]
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.DerivedThroughMid1' type=<root>.DerivedThroughMid1 origin=null
VAR name:md2 type:<root>.DerivedThroughMid2 [val]
CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in <root>.DerivedThroughMid2' type=<root>.DerivedThroughMid2 origin=null
VAR name:mk type:kotlin.Any [val]
WHEN type=kotlin.Any origin=IF
BRANCH
if: GET_VAR 'b: kotlin.Boolean declared in <root>.test' type=kotlin.Boolean origin=null
then: GET_VAR 'val md1: <root>.DerivedThroughMid1 [val] declared in <root>.test' type=<root>.DerivedThroughMid1 origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: GET_VAR 'val md2: <root>.DerivedThroughMid2 [val] declared in <root>.test' type=<root>.DerivedThroughMid2 origin=null
SET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:f type:kotlin.Int visibility:public' type=kotlin.Unit origin=EQ
receiver: TYPE_OP type=<root>.Mid origin=IMPLICIT_CAST typeOperand=<root>.Mid
GET_VAR 'val mk: kotlin.Any [val] declared in <root>.test' type=kotlin.Any origin=null
value: CONST Int type=kotlin.Int value=44
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:f type:kotlin.Int visibility:public' type=kotlin.Int origin=GET_PROPERTY
receiver: TYPE_OP type=<root>.Mid origin=IMPLICIT_CAST typeOperand=<root>.Mid
GET_VAR 'val mk: kotlin.Any [val] declared in <root>.test' type=kotlin.Any origin=null

View File

@@ -14,28 +14,28 @@ CLASS IR_EXTERNAL_DECLARATION_STUB CLASS name:J1 modality:OPEN visibility:public
TYPE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:X2 index:1 variance: superTypes:[<unbound IrClassPublicSymbolImpl>?]
$outer: VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:<this> type:<root>.J1<T1 of <root>.J1>
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:x2 index:0 type:X2 of <root>.J1.J2.<init>?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:<unbound IrClassPublicSymbolImpl>) returnType:<unbound IrClassPublicSymbolImpl> [fake_override]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:<unbound IrClassPublicSymbolImpl>, other:<unbound IrClassPublicSymbolImpl>?) returnType:<unbound IrClassPublicSymbolImpl> [fake_override,operator]
overridden:
public open fun equals (other: <unbound IrClassPublicSymbolImpl>?): <unbound IrClassPublicSymbolImpl> [operator] declared in kotlin.Any
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.Any
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:<unbound IrClassPublicSymbolImpl> [fake_override]
overridden:
public open fun hashCode (): <unbound IrClassPublicSymbolImpl> declared in kotlin.Any
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:<unbound IrClassPublicSymbolImpl> [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): <unbound IrClassPublicSymbolImpl> [operator] declared in kotlin.Any
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.Any
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:<unbound IrClassPublicSymbolImpl> [fake_override]
overridden:
public open fun toString (): <unbound IrClassPublicSymbolImpl> declared in kotlin.Any
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:<unbound IrClassPublicSymbolImpl> [fake_override]
overridden:
public open fun hashCode (): <unbound IrClassPublicSymbolImpl> declared in kotlin.Any
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:<unbound IrClassPublicSymbolImpl> [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): <unbound IrClassPublicSymbolImpl> [operator] declared in kotlin.Any
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.Any
VALUE_PARAMETER IR_EXTERNAL_DECLARATION_STUB name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:<unbound IrClassPublicSymbolImpl> [fake_override]
overridden:
public open fun hashCode (): <unbound IrClassPublicSymbolImpl> declared in kotlin.Any
$this: VALUE_PARAMETER FAKE_OVERRIDE name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:<unbound IrClassPublicSymbolImpl> [fake_override]
overridden:
public open fun toString (): <unbound IrClassPublicSymbolImpl> declared in kotlin.Any

View File

@@ -13668,6 +13668,16 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTestWithFirVali
runTest("compiler/testData/diagnostics/tests/j+k/sam/compatibilityResolveToOuterScopeForKotlinFunctions.kt");
}
@TestMetadata("conversionForDerivedGenericClass.kt")
public void testConversionForDerivedGenericClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/sam/conversionForDerivedGenericClass.kt");
}
@TestMetadata("conversionsWithNestedGenerics.kt")
public void testConversionsWithNestedGenerics() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/sam/conversionsWithNestedGenerics.kt");
}
@TestMetadata("enhancedSamConstructor.kt")
public void testEnhancedSamConstructor() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.kt");
@@ -13688,6 +13698,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTestWithFirVali
runTest("compiler/testData/diagnostics/tests/j+k/sam/kt37920.kt");
}
@TestMetadata("kt39630.kt")
public void testKt39630() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/sam/kt39630.kt");
}
@TestMetadata("privateCandidatesWithWrongArguments.kt")
public void testPrivateCandidatesWithWrongArguments() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/sam/privateCandidatesWithWrongArguments.kt");

View File

@@ -13663,6 +13663,16 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
runTest("compiler/testData/diagnostics/tests/j+k/sam/compatibilityResolveToOuterScopeForKotlinFunctions.kt");
}
@TestMetadata("conversionForDerivedGenericClass.kt")
public void testConversionForDerivedGenericClass() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/sam/conversionForDerivedGenericClass.kt");
}
@TestMetadata("conversionsWithNestedGenerics.kt")
public void testConversionsWithNestedGenerics() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/sam/conversionsWithNestedGenerics.kt");
}
@TestMetadata("enhancedSamConstructor.kt")
public void testEnhancedSamConstructor() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/sam/enhancedSamConstructor.kt");
@@ -13683,6 +13693,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing
runTest("compiler/testData/diagnostics/tests/j+k/sam/kt37920.kt");
}
@TestMetadata("kt39630.kt")
public void testKt39630() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/sam/kt39630.kt");
}
@TestMetadata("privateCandidatesWithWrongArguments.kt")
public void testPrivateCandidatesWithWrongArguments() throws Exception {
runTest("compiler/testData/diagnostics/tests/j+k/sam/privateCandidatesWithWrongArguments.kt");

View File

@@ -11595,6 +11595,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/enum/kt2350.kt");
}
@TestMetadata("kt38996.kt")
public void testKt38996() throws Exception {
runTest("compiler/testData/codegen/box/enum/kt38996.kt");
}
@TestMetadata("kt7257.kt")
public void testKt7257() throws Exception {
runTest("compiler/testData/codegen/box/enum/kt7257.kt");
@@ -13624,6 +13629,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
runTest("compiler/testData/codegen/box/inference/lastExpressionOfLambdaWithNothingConstraint.kt");
}
@TestMetadata("plusAssignInsideLambda.kt")
public void testPlusAssignInsideLambda() throws Exception {
runTest("compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt");
}
@TestMetadata("unsafeVarianceCodegen.kt")
public void testUnsafeVarianceCodegen() throws Exception {
runTest("compiler/testData/codegen/box/inference/unsafeVarianceCodegen.kt");

View File

@@ -11595,6 +11595,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/enum/kt2350.kt");
}
@TestMetadata("kt38996.kt")
public void testKt38996() throws Exception {
runTest("compiler/testData/codegen/box/enum/kt38996.kt");
}
@TestMetadata("kt7257.kt")
public void testKt7257() throws Exception {
runTest("compiler/testData/codegen/box/enum/kt7257.kt");
@@ -13624,6 +13629,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
runTest("compiler/testData/codegen/box/inference/lastExpressionOfLambdaWithNothingConstraint.kt");
}
@TestMetadata("plusAssignInsideLambda.kt")
public void testPlusAssignInsideLambda() throws Exception {
runTest("compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt");
}
@TestMetadata("unsafeVarianceCodegen.kt")
public void testUnsafeVarianceCodegen() throws Exception {
runTest("compiler/testData/codegen/box/inference/unsafeVarianceCodegen.kt");

View File

@@ -10375,6 +10375,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/enum/kt2350.kt");
}
@TestMetadata("kt38996.kt")
public void testKt38996() throws Exception {
runTest("compiler/testData/codegen/box/enum/kt38996.kt");
}
@TestMetadata("kt7257.kt")
public void testKt7257() throws Exception {
runTest("compiler/testData/codegen/box/enum/kt7257.kt");
@@ -12404,6 +12409,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
runTest("compiler/testData/codegen/box/inference/lastExpressionOfLambdaWithNothingConstraint.kt");
}
@TestMetadata("plusAssignInsideLambda.kt")
public void testPlusAssignInsideLambda() throws Exception {
runTest("compiler/testData/codegen/box/inference/plusAssignInsideLambda.kt");
}
@TestMetadata("unsafeVarianceCodegen.kt")
public void testUnsafeVarianceCodegen() throws Exception {
runTest("compiler/testData/codegen/box/inference/unsafeVarianceCodegen.kt");

View File

@@ -7,30 +7,30 @@ package org.jetbrains.kotlin.konan.file
import java.net.URI
import java.nio.file.*
import java.util.concurrent.ConcurrentHashMap
import java.nio.file.spi.FileSystemProvider
private val File.zipUri: URI
get() = URI.create("jar:${canonicalFile.toPath().toUri()}")
// Zip filesystem provider doesn't allow creating several instances of ZipFileSystem from the same URI,
// so newFileSystem(URI, ...) throws a FileSystemAlreadyExistsException in this case.
// But FileSystemProvider.newFileSystem(File, ...) cannot throw this exception and allows creating several filesystems.
// See also:
// https://bugs.java.com/bugdatabase/view_bug.do?bug_id=7001822
// https://bugs.java.com/bugdatabase/view_bug.do?bug_id=6994161
fun File.zipFileSystem(create: Boolean = false): FileSystem {
val attributes = hashMapOf("create" to create.toString())
private data class FileSystemRefCounter(val fileSystem: FileSystem, val counter: Int)
private val fileSystems = ConcurrentHashMap<URI, FileSystemRefCounter>()
// Zip filesystem provider creates a singleton zip FileSystem.
// So newFileSystem can return an already existing one.
// And, more painful, closing the filesystem could close it for another consumer thread.
fun File.zipFileSystem(mutable: Boolean = false): FileSystem {
val zipUri = this.zipUri
val attributes = hashMapOf("create" to mutable.toString())
return fileSystems.compute(zipUri) { key, value ->
if (value == null) {
FileSystemRefCounter(FileSystems.newFileSystem(key, attributes, null), 1)
} else {
// TODO: If a file system already exists, we cannot change its mutability.
FileSystemRefCounter(value.fileSystem, value.counter + 1)
// There is no FileSystems.newFileSystem overload accepting the attribute map.
// So we have to manually iterate over the filesystem providers.
return FileSystemProvider.installedProviders().filter { it.scheme == "jar" }.mapNotNull {
try {
it.newFileSystem(this.toPath(), attributes)
} catch(e: Exception) {
when(e) {
is UnsupportedOperationException,
is IllegalArgumentException -> null
else -> throw e
}
}
}!!.fileSystem
}.first()
}
fun FileSystem.file(file: File) = File(this.getPath(file.path))
@@ -40,7 +40,7 @@ fun FileSystem.file(path: String) = File(this.getPath(path))
private fun File.toPath() = Paths.get(this.path)
fun File.zipDirAs(unixFile: File) {
unixFile.withMutableZipFileSystem {
unixFile.withZipFileSystem(create = true) {
// Time attributes are not preserved to ensure that the output zip file bytes deterministic for a fixed set of
// input files.
this.recursiveCopyTo(it.file("/"), resetTimeAttributes = true)
@@ -55,25 +55,8 @@ fun Path.unzipTo(directory: Path) {
}
}
fun <T> File.withZipFileSystem(mutable: Boolean = false, action: (FileSystem) -> T): T {
val zipFileSystem = this.zipFileSystem(mutable)
return try {
action(zipFileSystem)
} finally {
fileSystems.compute(zipUri) { _, value ->
require(value != null)
if (value.counter == 1) {
value.fileSystem.close()
// Returning null removes this entry from the map
// See https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentMap.html.
null
} else {
FileSystemRefCounter(value.fileSystem, value.counter - 1)
}
}
}
fun <T> File.withZipFileSystem(create: Boolean, action: (FileSystem) -> T): T {
return this.zipFileSystem(create).use(action)
}
fun <T> File.withZipFileSystem(action: (FileSystem) -> T): T = this.withZipFileSystem(false, action)
fun <T> File.withMutableZipFileSystem(action: (FileSystem) -> T): T = this.withZipFileSystem(true, action)

View File

@@ -2,7 +2,7 @@ package org.jetbrains.kotlin.library
import org.jetbrains.kotlin.konan.file.File
import org.jetbrains.kotlin.konan.file.file
import org.jetbrains.kotlin.konan.file.withMutableZipFileSystem
import org.jetbrains.kotlin.konan.file.withZipFileSystem
import org.jetbrains.kotlin.library.impl.zippedKotlinLibraryChecks
const val KLIB_FILE_EXTENSION = "klib"
@@ -23,7 +23,7 @@ fun File.unpackZippedKonanLibraryTo(newDir: File) {
newDir.delete()
}
this.withMutableZipFileSystem {
this.withZipFileSystem {
it.file("/").recursiveCopyTo(newDir)
}
check(newDir.exists) { "Could not unpack $this as $newDir." }

View File

@@ -46,5 +46,9 @@ class InnerClassesScopeWrapper(val workerScope: MemberScope) : MemberScopeImpl()
override fun definitelyDoesNotContainName(name: Name) = workerScope.definitelyDoesNotContainName(name)
override fun recordLookup(name: Name, location: LookupLocation) {
workerScope.recordLookup(name, location)
}
override fun toString() = "Classes from $workerScope"
}

View File

@@ -46,6 +46,8 @@ interface MemberScope : ResolutionScope {
p.println("Empty member scope")
}
override fun definitelyDoesNotContainName(name: Name): Boolean = true
override fun getFunctionNames() = emptySet<Name>()
override fun getVariableNames() = emptySet<Name>()
override fun getClassifierNames() = emptySet<Name>()

View File

@@ -8,7 +8,7 @@ kotlin.compiler.newInferenceEnabled=true
#maven.repository.mirror=http://repository.jetbrains.com/remote-repos/
#bootstrap.kotlin.repo=https://dl.bintray.com/kotlin/kotlin-dev
#bootstrap.kotlin.version=1.1.50-dev-1451
bootstrap.kotlin.default.version=1.4.20-dev-710
bootstrap.kotlin.default.version=1.4.20-dev-772
#signingRequired=true

View File

@@ -49,6 +49,7 @@ import org.jetbrains.kotlin.idea.compiler.IDELanguageSettingsProvider
import org.jetbrains.kotlin.idea.core.script.ScriptDependenciesModificationTracker
import org.jetbrains.kotlin.idea.core.script.dependencies.ScriptAdditionalIdeaDependenciesProvider
import org.jetbrains.kotlin.idea.project.TargetPlatformDetector
import org.jetbrains.kotlin.idea.project.libraryToSourceAnalysisEnabled
import org.jetbrains.kotlin.idea.project.useCompositeAnalysis
import org.jetbrains.kotlin.idea.resolve.ResolutionFacade
import org.jetbrains.kotlin.idea.util.ProjectRootsUtil
@@ -204,7 +205,7 @@ class KotlinCacheServiceImpl(val project: Project) : KotlinCacheService {
project, librariesContext, settings,
reuseDataFrom = facadeForSdk,
moduleFilter = { it is LibraryInfo },
invalidateOnOOCB = false,
invalidateOnOOCB = project.libraryToSourceAnalysisEnabled,
dependencies = listOf(
LibraryModificationTracker.getInstance(project),
ProjectRootModificationTracker.getInstance(project)

View File

@@ -26,8 +26,7 @@ import com.intellij.util.indexing.IdFilter
import org.jetbrains.kotlin.asJava.elements.KtLightElement
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.idea.caches.KotlinShortNamesCache
import org.jetbrains.kotlin.idea.caches.resolve.resolveImportReference
import org.jetbrains.kotlin.idea.caches.resolve.unsafeResolveToDescriptor
import org.jetbrains.kotlin.idea.caches.resolve.*
import org.jetbrains.kotlin.idea.caches.resolve.util.getJavaMemberDescriptor
import org.jetbrains.kotlin.idea.caches.resolve.util.resolveToDescriptor
import org.jetbrains.kotlin.idea.codeInsight.forceEnableSamAdapters
@@ -264,7 +263,7 @@ class KotlinIndicesHelper(
fun getKotlinEnumsByName(name: String): Collection<DeclarationDescriptor> {
return KotlinClassShortNameIndex.getInstance()[name, project, scope]
.filter { it is KtEnumEntry && it in scope }
.mapNotNull { it.unsafeResolveToDescriptor() }
.flatMap { it.resolveToDescriptors<DeclarationDescriptor>() }
.filter(descriptorFilter)
.toSet()
}
@@ -367,10 +366,12 @@ class KotlinIndicesHelper(
for (declaration in functions + properties) {
ProgressManager.checkCanceled()
if (!filter(declaration)) continue
val descriptor = declaration.descriptor as? CallableDescriptor ?: continue
if (!processed.add(descriptor)) continue
if (!descriptorFilter(descriptor)) continue
processor(descriptor)
for (descriptor in declaration.resolveToDescriptors<CallableDescriptor>()) {
if (!processed.add(descriptor)) continue
if (!descriptorFilter(descriptor)) continue
processor(descriptor)
}
}
}
@@ -489,7 +490,7 @@ class KotlinIndicesHelper(
for (field in shortNamesCache.getFieldsByName(name, scopeWithoutKotlin).filterNot { it is KtLightElement<*, *> }) {
if (!field.hasModifierProperty(PsiModifier.STATIC)) continue
if (filterOutPrivate && field.hasModifierProperty(PsiModifier.PRIVATE)) continue
val descriptor = field.getJavaMemberDescriptor() ?: continue
val descriptor = field.getJavaMemberDescriptor(resolutionFacade) ?: continue
if (descriptorKindFilter.accepts(descriptor) && descriptorFilter(descriptor)) {
processor(descriptor)
}

View File

@@ -10,53 +10,61 @@ package org.jetbrains.kotlin.idea.scripting.gradle
import com.intellij.notification.*
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.application.ApplicationManager
import com.intellij.openapi.components.ServiceManager
import com.intellij.openapi.externalSystem.importing.ImportSpecBuilder
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil
import com.intellij.openapi.externalSystem.util.ExternalSystemUtil
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.Key
import com.intellij.openapi.util.registry.Registry
import com.intellij.openapi.vfs.VirtualFile
import org.gradle.util.GradleVersion
import org.jetbrains.kotlin.idea.KotlinIcons
import org.jetbrains.kotlin.idea.KotlinIdeaGradleBundle
import org.jetbrains.kotlin.idea.scripting.gradle.roots.GradleBuildRoot
import org.jetbrains.kotlin.idea.scripting.gradle.roots.GradleBuildRootsManager
import org.jetbrains.kotlin.idea.util.application.getServiceSafe
import org.jetbrains.kotlin.psi.UserDataProperty
import org.jetbrains.plugins.gradle.service.GradleInstallationManager
import org.jetbrains.plugins.gradle.settings.GradleProjectSettings
import org.jetbrains.plugins.gradle.util.GradleConstants
val scriptConfigurationsNeedToBeUpdatedBalloon
get() = Registry.`is`("kotlin.gradle.scripts.scriptConfigurationsNeedToBeUpdatedBalloon", false)
fun runPartialGradleImport(project: Project) {
getGradleProjectSettings(project).forEach {
ExternalSystemUtil.refreshProject(
it.externalProjectPath,
ImportSpecBuilder(project, GradleConstants.SYSTEM_ID)
.build()
)
fun runPartialGradleImportForAllRoots(project: Project) {
GradleBuildRootsManager.getInstance(project).getAllRoots().forEach { root ->
runPartialGradleImport(project, root)
}
}
fun runPartialGradleImport(project: Project, root: GradleBuildRoot) {
ExternalSystemUtil.refreshProject(
root.pathPrefix,
ImportSpecBuilder(project, GradleConstants.SYSTEM_ID)
.build()
)
}
fun getMissingConfigurationActionText() = KotlinIdeaGradleBundle.message("action.label.import.project")
fun autoReloadScriptConfigurations(project: Project): Boolean {
val gradleSettings = ExternalSystemApiUtil.getSettings(project, GradleConstants.SYSTEM_ID)
val projectSettings = gradleSettings.getLinkedProjectsSettings()
.filterIsInstance<GradleProjectSettings>()
.firstOrNull()
if (projectSettings != null) {
return projectSettings.isUseAutoImport
}
return false
fun autoReloadScriptConfigurations(project: Project, root: GradleBuildRoot): Boolean {
return ExternalSystemApiUtil
.getSettings(project, GradleConstants.SYSTEM_ID)
.getLinkedProjectSettings(root.pathPrefix)
?.isUseAutoImport ?: false
}
private const val kotlinDslNotificationGroupId = "Gradle Kotlin DSL Scripts"
private var Project.notificationPanel: ScriptConfigurationChangedNotification?
by UserDataProperty<Project, ScriptConfigurationChangedNotification>(Key.create("load.script.configuration.panel"))
fun scriptConfigurationsNeedToBeUpdated(project: Project) {
fun scriptConfigurationsNeedToBeUpdated(project: Project, file: VirtualFile) {
if (!scriptConfigurationsNeedToBeUpdatedBalloon) return
if (autoReloadScriptConfigurations(project)) {
val root = GradleBuildRootsManager.getInstance(project).getScriptInfo(file)?.buildRoot ?: return
if (autoReloadScriptConfigurations(project, root)) {
// import should be run automatically by Gradle plugin
return
}
@@ -98,14 +106,13 @@ private class ScriptConfigurationChangedNotification(val project: Project) :
init {
addAction(LoadConfigurationAction())
addAction(NotificationAction.createSimple(KotlinIdeaGradleBundle.message("action.label.enable.auto.import")) {
val gradleSettings = ExternalSystemApiUtil.getSettings(project, GradleConstants.SYSTEM_ID)
val projectSettings = gradleSettings.getLinkedProjectsSettings()
.filterIsInstance<GradleProjectSettings>()
.firstOrNull()
if (projectSettings != null) {
projectSettings.isUseAutoImport = true
GradleBuildRootsManager.getInstance(project).getAllRoots().forEach { root ->
val projectSettings = getGradleProjectSettings(project).find { it.externalProjectPath == root.pathPrefix }
if (projectSettings != null) {
projectSettings.isUseAutoImport = true
}
runPartialGradleImport(project, root)
}
runPartialGradleImport(project)
})
}
@@ -118,7 +125,15 @@ private class ScriptConfigurationChangedNotification(val project: Project) :
private class LoadConfigurationAction : AnAction(KotlinIdeaGradleBundle.message("action.label.import.project")) {
override fun actionPerformed(e: AnActionEvent) {
val project = e.project ?: return
runPartialGradleImport(project)
runPartialGradleImportForAllRoots(project)
}
}
}
fun getGradleVersion(project: Project, settings: GradleProjectSettings): String {
// workaround for bug in settings.resolveGradleVersion().version (fixed in 201)
return GradleInstallationManager.getGradleVersion(
ServiceManager.getService(GradleInstallationManager::class.java)
.getGradleHome(project, settings.externalProjectPath)?.path
) ?: GradleVersion.current().version
}

View File

@@ -23,34 +23,42 @@ import org.jetbrains.kotlin.idea.KotlinIcons
import org.jetbrains.kotlin.idea.KotlinIdeaGradleBundle
import org.jetbrains.kotlin.idea.core.script.settings.KotlinScriptingSettings
import org.jetbrains.kotlin.idea.scripting.gradle.importing.KotlinDslScriptModelResolver
import org.jetbrains.kotlin.idea.scripting.gradle.roots.GradleBuildRoot
import org.jetbrains.kotlin.idea.scripting.gradle.roots.GradleBuildRootsManager
import org.jetbrains.kotlin.scripting.definitions.findScriptDefinition
import org.jetbrains.plugins.gradle.service.project.GradlePartialResolverPolicy
import org.jetbrains.plugins.gradle.settings.GradleProjectSettings
import org.jetbrains.plugins.gradle.util.GradleConstants
fun runPartialGradleImport(project: Project) {
getGradleProjectSettings(project).forEach { gradleProjectSettings ->
ExternalSystemUtil.refreshProject(
gradleProjectSettings.externalProjectPath,
ImportSpecBuilder(project, GradleConstants.SYSTEM_ID)
.projectResolverPolicy(
GradlePartialResolverPolicy { it is KotlinDslScriptModelResolver }
)
)
fun runPartialGradleImportForAllRoots(project: Project) {
GradleBuildRootsManager.getInstance(project).getAllRoots().forEach { root ->
runPartialGradleImport(project, root)
}
}
fun getMissingConfigurationNotificationText() = KotlinIdeaGradleBundle.message("script.configurations.will.be.available.after.load.changes")
fun runPartialGradleImport(project: Project, root: GradleBuildRoot) {
ExternalSystemUtil.refreshProject(
root.pathPrefix,
ImportSpecBuilder(project, GradleConstants.SYSTEM_ID)
.projectResolverPolicy(
GradlePartialResolverPolicy { it is KotlinDslScriptModelResolver }
)
)
}
fun getMissingConfigurationActionText() = KotlinIdeaGradleBundle.message("action.text.load.script.configurations")
fun autoReloadScriptConfigurations(project: Project): Boolean {
return GradleScriptDefinitionsContributor.getDefinitions(project).any {
KotlinScriptingSettings.getInstance(project).autoReloadConfigurations(it)
}
fun autoReloadScriptConfigurations(project: Project, file: VirtualFile): Boolean {
val definition = file.findScriptDefinition(project) ?: return false
return KotlinScriptingSettings.getInstance(project).autoReloadConfigurations(definition)
}
fun scriptConfigurationsNeedToBeUpdated(project: Project) {
if (autoReloadScriptConfigurations(project)) {
runPartialGradleImport(project)
fun scriptConfigurationsNeedToBeUpdated(project: Project, file: VirtualFile) {
if (autoReloadScriptConfigurations(project, file)) {
GradleBuildRootsManager.getInstance(project).getScriptInfo(file)?.buildRoot?.let {
runPartialGradleImport(project, it)
}
} else {
// notification is shown in LoadConfigurationAction
}
@@ -65,7 +73,11 @@ class LoadConfigurationAction : AnAction(
) {
override fun actionPerformed(e: AnActionEvent) {
val project = e.project ?: return
runPartialGradleImport(project)
val editor = e.getData(CommonDataKeys.EDITOR) ?: return
val file = getKotlinScriptFile(editor) ?: return
val root = GradleBuildRootsManager.getInstance(project).getScriptInfo(file)?.buildRoot ?: return
runPartialGradleImport(project, root)
}
override fun update(e: AnActionEvent) {
@@ -86,7 +98,7 @@ class LoadConfigurationAction : AnAction(
val project = editor.project ?: return false
val file = getKotlinScriptFile(editor) ?: return false
if (autoReloadScriptConfigurations(project)) {
if (autoReloadScriptConfigurations(project, file)) {
return false
}
@@ -94,13 +106,17 @@ class LoadConfigurationAction : AnAction(
}
private fun getKotlinScriptFile(editor: Editor): VirtualFile? {
return FileDocumentManager.getInstance()
.getFile(editor.document)
?.takeIf {
it !is LightVirtualFileBase
&& it.isValid
&& it.fileType != KotlinFileType.INSTANCE
&& isGradleKotlinScript(it)
}
}
return FileDocumentManager.getInstance()
.getFile(editor.document)
?.takeIf {
it !is LightVirtualFileBase
&& it.isValid
&& it.fileType == KotlinFileType.INSTANCE
&& isGradleKotlinScript(it)
}
}
}
fun getGradleVersion(project: Project, settings: GradleProjectSettings): String {
return settings.resolveGradleVersion().version
}

View File

@@ -6,29 +6,33 @@
package org.jetbrains.kotlin.idea.scripting.gradle
import com.intellij.execution.configurations.CommandLineTokenizer
import com.intellij.openapi.diagnostic.Logger
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil
import com.intellij.openapi.project.Project
import com.intellij.util.EnvironmentUtil
import com.intellij.util.PathUtil
import org.gradle.util.GradleVersion
import org.jetbrains.kotlin.idea.KotlinIdeaGradleBundle
import org.jetbrains.kotlin.idea.core.script.ScriptDefinitionContributor
import org.jetbrains.kotlin.idea.core.script.ScriptDefinitionSourceAsContributor
import org.jetbrains.kotlin.idea.core.script.ScriptDefinitionsManager
import org.jetbrains.kotlin.idea.core.script.loadDefinitionsFromTemplates
import org.jetbrains.kotlin.idea.scripting.gradle.importing.KotlinDslSyncListener
import org.jetbrains.kotlin.idea.scripting.gradle.roots.GradleBuildRootsManager
import org.jetbrains.kotlin.idea.scripting.gradle.roots.Imported
import org.jetbrains.kotlin.idea.scripting.gradle.roots.WithoutScriptModels
import org.jetbrains.kotlin.scripting.definitions.KotlinScriptDefinitionAdapterFromNewAPIBase
import org.jetbrains.kotlin.scripting.definitions.ScriptDefinition
import org.jetbrains.kotlin.scripting.definitions.getEnvironment
import org.jetbrains.kotlin.scripting.resolve.KotlinScriptDefinitionFromAnnotatedTemplate
import org.jetbrains.plugins.gradle.config.GradleSettingsListenerAdapter
import org.jetbrains.plugins.gradle.service.GradleInstallationManager
import org.jetbrains.plugins.gradle.settings.DistributionType
import org.jetbrains.plugins.gradle.settings.GradleExecutionSettings
import org.jetbrains.plugins.gradle.settings.GradleProjectSettings
import org.jetbrains.plugins.gradle.settings.GradleSettingsListener
import org.jetbrains.plugins.gradle.util.GradleConstants
import java.io.File
import java.util.*
import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.ConcurrentHashMap
import kotlin.reflect.KClass
import kotlin.script.dependencies.Environment
import kotlin.script.dependencies.ScriptContents
@@ -42,23 +46,236 @@ import kotlin.script.templates.standard.ScriptTemplateWithArgs
class GradleScriptDefinitionsContributor(private val project: Project) : ScriptDefinitionSourceAsContributor {
companion object {
fun getDefinitions(project: Project) =
ScriptDefinitionContributor.EP_NAME.getExtensions(project)
fun getDefinitions(project: Project, workingDir: String, gradleHome: String?): List<ScriptDefinition>? {
val contributor = ScriptDefinitionContributor.EP_NAME.getExtensions(project)
.filterIsInstance<GradleScriptDefinitionsContributor>()
.single().definitions.toList()
.singleOrNull()
fun getDefinitionsTemplateClasspath(project: Project): MutableSet<String> =
mutableSetOf<String>().also { result ->
getDefinitions(project).forEach { definition ->
definition.asLegacyOrNull<KotlinScriptDefinitionFromAnnotatedTemplate>()
?.templateClasspath
?.mapNotNullTo(result) { it.path }
}
if (contributor == null) {
scriptingInfoLog(
"cannot find gradle script definitions contributor in ScriptDefinitionContributor.EP_NAME list: " +
"workingDir=$workingDir gradleHome=$gradleHome"
)
return null
}
if (gradleHome == null) {
scriptingInfoLog(KotlinIdeaGradleBundle.message("error.text.unable.to.get.gradle.home.directory") + ": workingDir=$workingDir gradleHome=$gradleHome")
return null
}
val root = LightGradleBuildRoot(workingDir, gradleHome)
val definitions = contributor.definitionsByRoots[root]
if (definitions == null) {
scriptingInfoLog(
"script definitions aren't loaded yet. " +
"They should be loaded by invoking GradleScriptDefinitionsContributor.reloadIfNeeded from KotlinDslSyncListener: " +
"workingDir=$workingDir gradleHome=$gradleHome"
)
return null
}
return definitions
}
fun getDefinitionsTemplateClasspath(gradleHome: String?): List<String> {
return try {
getFullDefinitionsClasspath(gradleHome).first.map {
PathUtil.toSystemIndependentName(it.path)
}
} catch (e: Throwable) {
scriptingInfoLog("cannot get gradle classpath for Gradle Kotlin DSL scripts: ${e.message}")
emptyList()
}
}
private val kotlinDslDependencySelector = Regex("^gradle-(?:kotlin-dsl|core).*\\.jar\$")
private fun getFullDefinitionsClasspath(gradleHome: String?): Pair<List<File>, List<File>> {
if (gradleHome == null) {
error(KotlinIdeaGradleBundle.message("error.text.unable.to.get.gradle.home.directory"))
}
val gradleLibDir = File(gradleHome, "lib")
.let {
it.takeIf { it.exists() && it.isDirectory }
?: error(KotlinIdeaGradleBundle.message("error.text.invalid.gradle.libraries.directory", it))
}
val templateClasspath = gradleLibDir
/* an inference problem without explicit 'it', TODO: remove when fixed */
.listFiles { it -> kotlinDslDependencySelector.matches(it.name) }
?.takeIf { it.isNotEmpty() }
?.asList()
?: error(KotlinIdeaGradleBundle.message("error.text.missing.jars.in.gradle.directory"))
scriptingDebugLog { "gradle script templates classpath $templateClasspath" }
val additionalClassPath = kotlinStdlibAndCompiler(gradleLibDir)
scriptingDebugLog { "gradle script templates additional classpath $templateClasspath" }
return templateClasspath to additionalClassPath
}
// TODO: check this against kotlin-dsl branch that uses daemon
private fun kotlinStdlibAndCompiler(gradleLibDir: File): List<File> {
// additionally need compiler jar to load gradle resolver
return gradleLibDir.listFiles { file ->
file?.name?.startsWith("kotlin-compiler-embeddable") == true || file?.name?.startsWith("kotlin-stdlib") == true
}?.firstOrNull()?.let(::listOf).orEmpty()
}
}
override val id: String = "Gradle Kotlin DSL"
private val failedToLoad = AtomicBoolean(false)
private data class LightGradleBuildRoot(val workingDir: String, val gradleHome: String?)
private val definitionsByRoots = ConcurrentHashMap<LightGradleBuildRoot, List<ScriptDefinition>>()
private fun LightGradleBuildRoot.markAsError() {
definitionsByRoots[this] = listOf(ErrorGradleScriptDefinition(project))
}
private fun LightGradleBuildRoot.isError(): Boolean {
return definitionsByRoots[this]?.any { it is ErrorGradleScriptDefinition } ?: false
}
private fun forceReload() {
for (key in definitionsByRoots.keys()) {
key.markAsError()
}
ScriptDefinitionsManager.getInstance(project).reloadDefinitionsBy(this)
}
// TODO: remove old roots
fun reloadIfNeeded(workingDir: String, gradleHome: String?) {
val root = LightGradleBuildRoot(workingDir, gradleHome)
val value = definitionsByRoots[root]
if (value != null) {
if (root.isError()) {
ScriptDefinitionsManager.getInstance(project).reloadDefinitionsBy(this)
}
} else {
val rootWithChangedGradleHome = definitionsByRoots.filter { it.key.workingDir == workingDir }
if (rootWithChangedGradleHome.isNotEmpty()) {
rootWithChangedGradleHome.forEach {
definitionsByRoots.remove(it.key)
}
}
root.markAsError()
ScriptDefinitionsManager.getInstance(project).reloadDefinitionsBy(this)
}
}
private fun loadGradleDefinitions(root: LightGradleBuildRoot): List<ScriptDefinition> {
try {
val (templateClasspath, additionalClassPath) = getFullDefinitionsClasspath(root.gradleHome)
val kotlinDslTemplates = ArrayList<ScriptDefinition>()
val projectPath = root.workingDir
loadGradleTemplates(
projectPath,
templateClass = "org.gradle.kotlin.dsl.KotlinInitScript",
root.gradleHome,
templateClasspath,
additionalClassPath
).let { kotlinDslTemplates.addAll(it) }
loadGradleTemplates(
projectPath,
templateClass = "org.gradle.kotlin.dsl.KotlinSettingsScript",
gradleHome = root.gradleHome,
templateClasspath = templateClasspath,
additionalClassPath = additionalClassPath
).let { kotlinDslTemplates.addAll(it) }
// KotlinBuildScript should be last because it has wide scriptFilePattern
loadGradleTemplates(
projectPath,
templateClass = "org.gradle.kotlin.dsl.KotlinBuildScript",
gradleHome = root.gradleHome,
templateClasspath = templateClasspath,
additionalClassPath = additionalClassPath
).let { kotlinDslTemplates.addAll(it) }
if (kotlinDslTemplates.isNotEmpty()) {
return kotlinDslTemplates.distinct()
}
} catch (t: Throwable) {
// TODO: review exception handling
if (t is IllegalStateException) {
scriptingInfoLog("IllegalStateException loading gradle script templates: ${t.message}")
} else {
scriptingDebugLog { "error loading gradle script templates ${t.message}" }
}
return listOf(ErrorGradleScriptDefinition(project, t.message))
}
return listOf(ErrorGradleScriptDefinition(project))
}
private fun loadGradleTemplates(
projectPath: String,
templateClass: String,
gradleHome: String?,
templateClasspath: List<File>,
additionalClassPath: List<File>
): List<ScriptDefinition> {
val gradleExeSettings = ExternalSystemApiUtil.getExecutionSettings<GradleExecutionSettings>(
project,
projectPath,
GradleConstants.SYSTEM_ID
)
val hostConfiguration = createHostConfiguration(projectPath, gradleHome, gradleExeSettings)
return loadDefinitionsFromTemplates(
listOf(templateClass),
templateClasspath,
hostConfiguration,
additionalClassPath
).map {
it.asLegacyOrNull<KotlinScriptDefinitionFromAnnotatedTemplate>()?.let { legacyDef ->
// Expand scope for old gradle script definition
val version = GradleInstallationManager.getGradleVersion(gradleHome) ?: GradleVersion.current().version
GradleKotlinScriptDefinitionWrapper(
it.hostConfiguration,
legacyDef,
version
)
} ?: it
}
}
private fun createHostConfiguration(
projectPath: String,
gradleHome: String?,
gradleExeSettings: GradleExecutionSettings
): ScriptingHostConfiguration {
val gradleJvmOptions = gradleExeSettings.daemonVmOptions?.let { vmOptions ->
CommandLineTokenizer(vmOptions).toList()
.mapNotNull { it?.let { it as? String } }
.filterNot(String::isBlank)
.distinct()
} ?: emptyList()
val environment = mapOf(
"gradleHome" to gradleHome?.let(::File),
"gradleJavaHome" to gradleExeSettings.javaHome, // TODO: should be taken from information from gradle sync
"projectRoot" to projectPath.let(::File),
"gradleOptions" to emptyList<String>(), // There is no option in UI to set project wide gradleOptions
"gradleJvmOptions" to gradleJvmOptions,
"gradleEnvironmentVariables" to if (gradleExeSettings.isPassParentEnvs) EnvironmentUtil.getEnvironmentMap() else emptyMap()
)
return ScriptingHostConfiguration(defaultJvmScriptingHostConfiguration) {
getEnvironment { environment }
}
}
init {
subscribeToGradleSettingChanges()
@@ -67,19 +284,19 @@ class GradleScriptDefinitionsContributor(private val project: Project) : ScriptD
private fun subscribeToGradleSettingChanges() {
val listener = object : GradleSettingsListenerAdapter() {
override fun onGradleVmOptionsChange(oldOptions: String?, newOptions: String?) {
reload()
forceReload()
}
override fun onGradleHomeChange(oldPath: String?, newPath: String?, linkedProjectPath: String) {
reload()
forceReload()
}
override fun onServiceDirectoryPathChange(oldPath: String?, newPath: String?) {
reload()
forceReload()
}
override fun onGradleDistributionTypeChange(currentValue: DistributionType?, linkedProjectPath: String) {
reload()
forceReload()
}
}
project.messageBus.connect().subscribe(GradleSettingsListener.TOPIC, listener)
@@ -89,214 +306,87 @@ class GradleScriptDefinitionsContributor(private val project: Project) : ScriptD
// TODO: possibly combine exceptions from every loadGradleTemplates call, be mindful of KT-19276
override val definitions: Sequence<ScriptDefinition>
get() {
val kotlinDslDependencySelector = Regex("^gradle-(?:kotlin-dsl|core).*\\.jar\$")
val kotlinDslAdditionalResolverCp = ::kotlinStdlibAndCompiler
failedToLoad.set(false)
val kotlinDslTemplates = ArrayList<ScriptDefinition>()
loadGradleTemplates(
templateClass = "org.gradle.kotlin.dsl.KotlinInitScript",
dependencySelector = kotlinDslDependencySelector,
additionalResolverClasspath = kotlinDslAdditionalResolverCp
).let { kotlinDslTemplates.addAll(it) }
loadGradleTemplates(
templateClass = "org.gradle.kotlin.dsl.KotlinSettingsScript",
dependencySelector = kotlinDslDependencySelector,
additionalResolverClasspath = kotlinDslAdditionalResolverCp
).let { kotlinDslTemplates.addAll(it) }
// KotlinBuildScript should be last because it has wide scriptFilePattern
loadGradleTemplates(
templateClass = "org.gradle.kotlin.dsl.KotlinBuildScript",
dependencySelector = kotlinDslDependencySelector,
additionalResolverClasspath = kotlinDslAdditionalResolverCp
).let { kotlinDslTemplates.addAll(it) }
if (kotlinDslTemplates.isNotEmpty()) {
return kotlinDslTemplates.distinct().asSequence()
definitionsByRoots.keys().iterator().forEachRemaining { root ->
// reload definitions marked as error
if (root.isError()) {
definitionsByRoots[root] = loadGradleDefinitions(root)
}
}
val default = tryToLoadOldBuildScriptDefinition()
if (default.isNotEmpty()) {
return default.distinct().asSequence()
if (definitionsByRoots.isEmpty()) {
// can be empty in case when import wasn't done from IDE start up,
// otherwise KotlinDslSyncListener should run reloadIfNeeded for valid roots
GradleBuildRootsManager.getInstance(project).getAllRoots().forEach {
val workingDir = it.pathPrefix
val gradleHome = when (it) {
is Imported -> {
it.data.gradleHome
}
is WithoutScriptModels -> {
ExternalSystemApiUtil.getExecutionSettings<GradleExecutionSettings>(
project,
workingDir,
GradleConstants.SYSTEM_ID
).gradleHome
}
}
val root = LightGradleBuildRoot(workingDir, gradleHome)
definitionsByRoots[root] = loadGradleDefinitions(root)
}
}
if (definitionsByRoots.isNotEmpty()) {
return definitionsByRoots.flatMap { it.value }.asSequence()
}
return sequenceOf(ErrorGradleScriptDefinition(project))
}
private fun tryToLoadOldBuildScriptDefinition(): List<ScriptDefinition> {
failedToLoad.set(false)
return loadGradleTemplates(
templateClass = "org.gradle.script.lang.kotlin.KotlinBuildScript",
dependencySelector = Regex("^gradle-(?:script-kotlin|core).*\\.jar\$"),
additionalResolverClasspath = { emptyList() }
)
}
}
// TODO: check this against kotlin-dsl branch that uses daemon
private fun kotlinStdlibAndCompiler(gradleLibDir: File): List<File> {
// additionally need compiler jar to load gradle resolver
return gradleLibDir.listFiles { file ->
file.name.startsWith("kotlin-compiler-embeddable") || file.name.startsWith("kotlin-stdlib")
// TODO: refactor - minimize
private class ErrorGradleScriptDefinition(project: Project, message: String? = null) :
ScriptDefinition.FromLegacy(
ScriptingHostConfiguration(defaultJvmScriptingHostConfiguration),
LegacyDefinition(project, message)
) {
private class LegacyDefinition(project: Project, message: String?) : KotlinScriptDefinitionAdapterFromNewAPIBase() {
companion object {
private const val KOTLIN_DSL_SCRIPT_EXTENSION = "gradle.kts"
}
.firstOrNull()?.let(::listOf).orEmpty()
override val name: String get() = KotlinIdeaGradleBundle.message("text.default.kotlin.gradle.script")
override val fileExtension: String = KOTLIN_DSL_SCRIPT_EXTENSION
override val scriptCompilationConfiguration: ScriptCompilationConfiguration = ScriptCompilationConfiguration.Default
override val hostConfiguration: ScriptingHostConfiguration = ScriptingHostConfiguration(defaultJvmScriptingHostConfiguration)
override val baseClass: KClass<*> = ScriptTemplateWithArgs::class
override val dependencyResolver: DependenciesResolver =
ErrorScriptDependenciesResolver(project, message)
override fun toString(): String = "ErrorGradleScriptDefinition"
}
private fun loadGradleTemplates(
templateClass: String, dependencySelector: Regex,
additionalResolverClasspath: (gradleLibDir: File) -> List<File>
): List<ScriptDefinition> = try {
doLoadGradleTemplates(templateClass, dependencySelector, additionalResolverClasspath)
} catch (t: Throwable) {
scriptingDebugLog { "error loading gradle script templates ${t.message}" }
// TODO: review exception handling
failedToLoad.set(true)
if (t is IllegalStateException) {
Logger.getInstance(GradleScriptDefinitionsContributor::class.java)
.info("[kts] error loading gradle script templates: ${t.message}")
}
listOf(ErrorGradleScriptDefinition(project, t.message))
}
override fun equals(other: Any?): Boolean = other is ErrorGradleScriptDefinition
override fun hashCode(): Int = name.hashCode()
}
private fun doLoadGradleTemplates(
templateClass: String, dependencySelector: Regex,
additionalResolverClasspath: (gradleLibDir: File) -> List<File>
): List<ScriptDefinition> {
fun createHostConfiguration(
gradleExeSettings: GradleExecutionSettings,
projectSettings: GradleProjectSettings
): ScriptingHostConfiguration {
val gradleJvmOptions = gradleExeSettings.daemonVmOptions?.let { vmOptions ->
CommandLineTokenizer(vmOptions).toList()
.mapNotNull { it?.let { it as? String } }
.filterNot(String::isBlank)
.distinct()
} ?: emptyList()
val environment = mapOf(
"gradleHome" to gradleExeSettings.gradleHome?.let(::File),
"gradleJavaHome" to gradleExeSettings.javaHome,
"projectRoot" to projectSettings.externalProjectPath.let(::File),
"gradleOptions" to emptyList<String>(), // There is no option in UI to set project wide gradleOptions
"gradleJvmOptions" to gradleJvmOptions,
"gradleEnvironmentVariables" to if (gradleExeSettings.isPassParentEnvs) EnvironmentUtil.getEnvironmentMap() else emptyMap()
private class ErrorScriptDependenciesResolver(
private val project: Project,
private val message: String? = null
) : DependenciesResolver {
override fun resolve(scriptContents: ScriptContents, environment: Environment): ResolveResult {
val importTasks = KotlinDslSyncListener.instance.tasks
val importInProgress = synchronized(importTasks) { importTasks.values.any { it.project == project } }
val failureMessage = if (importInProgress) {
KotlinIdeaGradleBundle.message("error.text.highlighting.is.impossible.during.gradle.import")
} else {
message ?: KotlinIdeaGradleBundle.message(
"error.text.failed.to.load.script.definitions.by",
GradleScriptDefinitionsContributor::class.java.name
)
return ScriptingHostConfiguration(defaultJvmScriptingHostConfiguration) {
getEnvironment { environment }
}
}
val gradleSettings = ExternalSystemApiUtil.getSettings(project, GradleConstants.SYSTEM_ID)
if (gradleSettings.getLinkedProjectsSettings().isEmpty())
error(KotlinIdeaGradleBundle.message("error.text.project.isn.t.linked.with.gradle", project.name))
val projectSettings = gradleSettings.getLinkedProjectsSettings().filterIsInstance<GradleProjectSettings>().firstOrNull()
?: error(KotlinIdeaGradleBundle.message("error.text.project.isn.t.linked.with.gradle", project.name))
val gradleExeSettings = ExternalSystemApiUtil.getExecutionSettings<GradleExecutionSettings>(
project,
projectSettings.externalProjectPath,
GradleConstants.SYSTEM_ID
)
val gradleHome = gradleExeSettings.gradleHome
?: error(KotlinIdeaGradleBundle.message("error.text.unable.to.get.gradle.home.directory"))
val gradleLibDir = File(gradleHome, "lib").let {
it.takeIf { it.exists() && it.isDirectory }
?: error(KotlinIdeaGradleBundle.message("error.text.invalid.gradle.libraries.directory", it))
}
val templateClasspath = gradleLibDir.listFiles { it ->
/* an inference problem without explicit 'it', TODO: remove when fixed */
dependencySelector.matches(it.name)
}.takeIf { it.isNotEmpty() }?.asList() ?: error(KotlinIdeaGradleBundle.message("error.text.missing.jars.in.gradle.directory"))
scriptingDebugLog { "loading gradle script templates from $templateClasspath" }
return loadDefinitionsFromTemplates(
listOf(templateClass),
templateClasspath,
createHostConfiguration(gradleExeSettings, projectSettings),
additionalResolverClasspath(gradleLibDir)
).map {
it.asLegacyOrNull<KotlinScriptDefinitionFromAnnotatedTemplate>()?.let { legacyDef ->
// Expand scope for old gradle script definition
GradleKotlinScriptDefinitionWrapper(
it.hostConfiguration,
legacyDef,
projectSettings.resolveGradleVersion().version
)
} ?: it
}
}
fun reloadIfNecessary() {
if (failedToLoad.compareAndSet(true, false)) {
reload()
}
}
private fun reload() {
ScriptDefinitionsManager.getInstance(project).reloadDefinitionsBy(this)
}
// TODO: refactor - minimize
private class ErrorGradleScriptDefinition(project: Project, message: String? = null) :
ScriptDefinition.FromLegacy(
ScriptingHostConfiguration(defaultJvmScriptingHostConfiguration),
LegacyDefinition(project, message)
) {
private class LegacyDefinition(project: Project, message: String?) : KotlinScriptDefinitionAdapterFromNewAPIBase() {
companion object {
private const val KOTLIN_DSL_SCRIPT_EXTENSION = "gradle.kts"
}
override val name: String get() = KotlinIdeaGradleBundle.message("text.default.kotlin.gradle.script")
override val fileExtension: String = KOTLIN_DSL_SCRIPT_EXTENSION
override val scriptCompilationConfiguration: ScriptCompilationConfiguration = ScriptCompilationConfiguration.Default
override val hostConfiguration: ScriptingHostConfiguration = ScriptingHostConfiguration(defaultJvmScriptingHostConfiguration)
override val baseClass: KClass<*> = ScriptTemplateWithArgs::class
override val dependencyResolver: DependenciesResolver =
ErrorScriptDependenciesResolver(project, message)
override fun toString(): String = "ErrorGradleScriptDefinition"
}
override fun equals(other: Any?): Boolean = other is ErrorGradleScriptDefinition
override fun hashCode(): Int = name.hashCode()
}
private class ErrorScriptDependenciesResolver(
private val project: Project,
private val message: String? = null
) : DependenciesResolver {
override fun resolve(scriptContents: ScriptContents, environment: Environment): ResolveResult {
val importTasks = KotlinDslSyncListener.instance.tasks
val importInProgress = synchronized(importTasks) { importTasks.values.any { it.project == project } }
val failureMessage = if (importInProgress) {
KotlinIdeaGradleBundle.message("error.text.highlighting.is.impossible.during.gradle.import")
} else {
message ?: KotlinIdeaGradleBundle.message(
"error.text.failed.to.load.script.definitions.by",
GradleScriptDefinitionsContributor::class.java.name
)
}
return ResolveResult.Failure(ScriptReport(failureMessage, ScriptReport.Severity.FATAL))
}
return ResolveResult.Failure(ScriptReport(failureMessage, ScriptReport.Severity.FATAL))
}
}

View File

@@ -49,18 +49,22 @@ class GradleScriptNotificationProvider(private val project: Project) :
wasNotImportedAfterCreation -> EditorNotificationPanel().apply {
text(KotlinIdeaGradleBundle.message("notification.wasNotImportedAfterCreation.text"))
createActionLabel(getMissingConfigurationActionText()) {
runPartialGradleImport(project)
val root = scriptUnderRoot.nearest
if (root != null) {
runPartialGradleImport(project, root)
}
}
}
notEvaluatedInLastImport -> EditorNotificationPanel().apply {
text(KotlinIdeaGradleBundle.message("notification.notEvaluatedInLastImport.text"))
// suggest to reimport project if something changed after import
val importTs = (scriptUnderRoot.nearest as? Imported)?.data?.importTs
if (importTs != null && !scriptUnderRoot.nearest.areRelatedFilesChangedBefore(file, importTs)) {
val root = scriptUnderRoot.nearest as? Imported
val importTs = root?.data?.importTs
if (root != null && importTs != null && !root.areRelatedFilesChangedBefore(file, importTs)) {
createActionLabel(getMissingConfigurationActionText()) {
rootsManager.updateStandaloneScripts {
runPartialGradleImport(project)
runPartialGradleImport(project, root)
}
}
}

View File

@@ -7,7 +7,6 @@ package org.jetbrains.kotlin.idea.scripting.gradle.importing
import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.Key
import com.intellij.openapi.util.io.FileUtil.toSystemIndependentName
import com.intellij.openapi.vfs.VfsUtil
import org.gradle.tooling.model.kotlin.dsl.EditorReportSeverity
@@ -16,10 +15,26 @@ import org.jetbrains.kotlin.gradle.BrokenKotlinDslScriptsModel
import org.jetbrains.kotlin.idea.KotlinIdeaGradleBundle
import org.jetbrains.kotlin.idea.scripting.gradle.getGradleScriptInputsStamp
import org.jetbrains.kotlin.idea.scripting.gradle.roots.GradleBuildRootsManager
import org.jetbrains.kotlin.psi.NotNullableUserDataProperty
import org.jetbrains.plugins.gradle.model.BuildScriptClasspathModel
import org.jetbrains.plugins.gradle.service.project.ProjectResolverContext
import java.io.File
import java.util.concurrent.ConcurrentHashMap
fun saveGradleBuildEnvironment(resolverCtx: ProjectResolverContext) {
val task = resolverCtx.externalSystemTaskId
val tasks = KotlinDslSyncListener.instance.tasks
val sync = synchronized(tasks) { tasks[task] }
if (sync != null) {
val gradleHome = resolverCtx.getExtraProject(BuildScriptClasspathModel::class.java)?.gradleHomeDir?.canonicalPath
?: resolverCtx.settings?.gradleHome
synchronized(sync) {
sync.gradleVersion = resolverCtx.projectGradleVersion
if (gradleHome != null) {
sync.gradleHome = toSystemIndependentName(gradleHome)
}
}
}
}
fun processScriptModel(
resolverCtx: ProjectResolverContext,
@@ -44,6 +59,11 @@ fun processScriptModel(
}
if (models.containsErrors()) {
if (sync != null) {
synchronized(sync) {
sync.failed = true
}
}
throw IllegalStateException(KotlinIdeaGradleBundle.message("title.kotlin.build.script"))
}
}
@@ -103,6 +123,8 @@ private fun KotlinDslScriptsModel.toListOfScriptModels(project: Project): List<K
class KotlinDslGradleBuildSync(val workingDir: String, val taskId: ExternalSystemTaskId) {
val ts = System.currentTimeMillis()
var project: Project? = null
var gradleVersion: String? = null
var gradleHome: String? = null
val projectRoots = mutableSetOf<String>()
val models = mutableListOf<KotlinDslScriptModel>()
var failed = false

View File

@@ -31,12 +31,10 @@ class KotlinDslScriptModelResolver : KotlinDslScriptModelResolverCommon() {
override fun populateProjectExtraModels(gradleProject: IdeaProject, ideProject: DataNode<ProjectData>) {
super.populateProjectExtraModels(gradleProject, ideProject)
if (kotlinDslScriptsModelImportSupported(resolverCtx.projectGradleVersion)) {
populateBuildModels(resolverCtx.models.mainBuild, ideProject)
populateBuildModels(resolverCtx.models.mainBuild, ideProject)
resolverCtx.models.includedBuilds.forEach { includedRoot ->
populateBuildModels(includedRoot, ideProject)
}
resolverCtx.models.includedBuilds.forEach { includedRoot ->
populateBuildModels(includedRoot, ideProject)
}
}
@@ -46,9 +44,13 @@ class KotlinDslScriptModelResolver : KotlinDslScriptModelResolverCommon() {
) {
root.projects.forEach {
if (it.projectIdentifier.projectPath == ":") {
resolverCtx.models.getModel(it, KotlinDslScriptsModel::class.java)?.let { model ->
processScriptModel(resolverCtx, model, it.projectIdentifier.projectPath)
if (kotlinDslScriptsModelImportSupported(resolverCtx.projectGradleVersion)) {
resolverCtx.models.getModel(it, KotlinDslScriptsModel::class.java)?.let { model ->
processScriptModel(resolverCtx, model, it.projectIdentifier.projectPath)
}
}
saveGradleBuildEnvironment(resolverCtx)
}
}
}

View File

@@ -29,12 +29,10 @@ class KotlinDslScriptModelResolver : KotlinDslScriptModelResolverCommon() {
override fun populateProjectExtraModels(gradleProject: IdeaProject, ideProject: DataNode<ProjectData>) {
super.populateProjectExtraModels(gradleProject, ideProject)
if (kotlinDslScriptsModelImportSupported(resolverCtx.projectGradleVersion)) {
populateBuildModels(gradleProject, ideProject)
populateBuildModels(gradleProject, ideProject)
resolverCtx.models.includedBuilds.forEach { includedRoot ->
populateBuildModels(includedRoot, ideProject)
}
resolverCtx.models.includedBuilds.forEach { includedRoot ->
populateBuildModels(includedRoot, ideProject)
}
}
@@ -44,9 +42,13 @@ class KotlinDslScriptModelResolver : KotlinDslScriptModelResolverCommon() {
) {
root.modules.forEach {
if (it.gradleProject.parent == null) {
resolverCtx.getExtraProject(it, KotlinDslScriptsModel::class.java)?.let { model ->
processScriptModel(resolverCtx, model, it.name)
if (kotlinDslScriptsModelImportSupported(resolverCtx.projectGradleVersion)) {
resolverCtx.getExtraProject(it, KotlinDslScriptsModel::class.java)?.let { model ->
processScriptModel(resolverCtx, model, it.name)
}
}
saveGradleBuildEnvironment(resolverCtx)
}
}
}

View File

@@ -5,12 +5,12 @@
package org.jetbrains.kotlin.idea.scripting.gradle.importing
import org.jetbrains.plugins.gradle.model.ClassSetImportModelProvider
import org.jetbrains.plugins.gradle.model.ProjectImportModelProvider
import org.gradle.tooling.model.kotlin.dsl.KotlinDslScriptsModel
import org.jetbrains.kotlin.gradle.KotlinDslScriptAdditionalTask
import org.jetbrains.kotlin.gradle.KotlinDslScriptModelProvider
import org.gradle.tooling.model.kotlin.dsl.KotlinDslScriptsModel
import org.jetbrains.kotlin.idea.scripting.gradle.kotlinDslScriptsModelImportSupported
import org.jetbrains.plugins.gradle.model.ClassSetImportModelProvider
import org.jetbrains.plugins.gradle.model.ProjectImportModelProvider
import org.jetbrains.plugins.gradle.service.project.ModifiableGradleProjectModel
import org.jetbrains.plugins.gradle.service.project.ProjectModelContributor
import org.jetbrains.plugins.gradle.service.project.ProjectResolverContext
@@ -34,17 +34,19 @@ class KotlinDslScriptModelContributor : ProjectModelContributor {
override fun accept(
projectModelBuilder: ModifiableGradleProjectModel,
toolingModelsProvider: ToolingModelsProvider,
resolverContext: ProjectResolverContext
resolverCtx: ProjectResolverContext
) {
if (!kotlinDslScriptsModelImportSupported(resolverContext.projectGradleVersion)) return
toolingModelsProvider.projects().forEach {
val projectIdentifier = it.projectIdentifier.projectPath
if (projectIdentifier == ":") {
val model = toolingModelsProvider.getProjectModel(it, KotlinDslScriptsModel::class.java)
if (model != null) {
processScriptModel(resolverContext, model, projectIdentifier)
if (kotlinDslScriptsModelImportSupported(resolverCtx.projectGradleVersion)) {
val model = toolingModelsProvider.getProjectModel(it, KotlinDslScriptsModel::class.java)
if (model != null) {
processScriptModel(resolverCtx, model, projectIdentifier)
}
}
saveGradleBuildEnvironment(resolverCtx)
}
}
}

View File

@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.idea.scripting.gradle.importing
import com.intellij.openapi.components.ServiceManager
import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskId
import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListener
import com.intellij.openapi.externalSystem.model.task.ExternalSystemTaskNotificationListenerAdapter
@@ -13,6 +14,7 @@ import org.jetbrains.kotlin.idea.core.script.ScriptDefinitionContributor
import org.jetbrains.kotlin.idea.framework.GRADLE_SYSTEM_ID
import org.jetbrains.kotlin.idea.scripting.gradle.GradleScriptDefinitionsContributor
import org.jetbrains.kotlin.idea.scripting.gradle.roots.GradleBuildRootsManager
import org.jetbrains.plugins.gradle.service.GradleInstallationManager
import java.util.*
class KotlinDslSyncListener : ExternalSystemTaskNotificationListenerAdapter() {
@@ -45,8 +47,15 @@ class KotlinDslSyncListener : ExternalSystemTaskNotificationListenerAdapter() {
// project may be null in case of new project
val project = id.findProject() ?: return
if (sync.gradleHome == null) {
sync.gradleHome = ServiceManager
.getService(GradleInstallationManager::class.java)
.getGradleHome(project, sync.workingDir)
?.canonicalPath
}
@Suppress("DEPRECATION")
ScriptDefinitionContributor.find<GradleScriptDefinitionsContributor>(project)?.reloadIfNecessary()
ScriptDefinitionContributor.find<GradleScriptDefinitionsContributor>(project)?.reloadIfNeeded(sync.workingDir, sync.gradleHome)
saveScriptModels(project, sync)
}

View File

@@ -96,12 +96,17 @@ class Imported(
builder.sdks.addSdk(javaHome)
}
val definitions = GradleScriptDefinitionsContributor.getDefinitions(builder.project)
val definitions = GradleScriptDefinitionsContributor.getDefinitions(builder.project, pathPrefix, data.gradleHome)
if (definitions == null) {
// needed to recreate classRoots if correct script definitions weren't loaded at this moment
// in this case classRoots will be recreated after script definitions update
builder.useCustomScriptDefinition()
}
builder.addTemplateClassesRoots(data.templateClasspath)
builder.addTemplateClassesRoots(GradleScriptDefinitionsContributor.getDefinitionsTemplateClasspath(data.gradleHome))
data.models.forEach { script ->
val definition = selectScriptDefinition(script, definitions)
val definition = definitions?.let { selectScriptDefinition(script, it) }
builder.addCustom(
script.file,

View File

@@ -10,6 +10,6 @@ import org.jetbrains.kotlin.idea.scripting.gradle.importing.KotlinDslScriptModel
data class GradleBuildRootData(
val importTs: Long,
val projectRoots: Collection<String>,
val templateClasspath: Collection<String>,
val gradleHome: String,
val models: Collection<KotlinDslScriptModel>
)

View File

@@ -19,7 +19,7 @@ import java.io.DataInputStream
import java.io.DataOutput
internal object GradleBuildRootDataSerializer {
private val attribute = FileAttribute("kotlin-dsl-script-models", 6, false)
private val attribute = FileAttribute("kotlin-dsl-script-models", 7, false)
fun read(buildRoot: VirtualFile): GradleBuildRootData? {
return attribute.readAttribute(buildRoot)?.use {
@@ -46,7 +46,7 @@ internal object GradleBuildRootDataSerializer {
internal fun writeKotlinDslScriptModels(output: DataOutput, data: GradleBuildRootData) {
val strings = StringsPool.writer(output)
strings.addStrings(data.projectRoots)
strings.addStrings(data.templateClasspath)
strings.addString(data.gradleHome)
data.models.forEach {
strings.addString(it.file)
strings.addStrings(it.classPath)
@@ -56,7 +56,7 @@ internal fun writeKotlinDslScriptModels(output: DataOutput, data: GradleBuildRoo
strings.writeHeader()
output.writeLong(data.importTs)
strings.writeStringIds(data.projectRoots)
strings.writeStringIds(data.templateClasspath)
strings.writeStringId(data.gradleHome)
output.writeList(data.models) {
strings.writeStringId(it.file)
output.writeString(it.inputs.sections)
@@ -72,7 +72,7 @@ internal fun readKotlinDslScriptModels(input: DataInputStream, buildRoot: String
val importTs = input.readLong()
val projectRoots = strings.readStrings()
val templateClasspath = strings.readStrings()
val gradleHome = strings.readString()
val models = input.readList {
KotlinDslScriptModel(
strings.readString(),
@@ -84,7 +84,7 @@ internal fun readKotlinDslScriptModels(input: DataInputStream, buildRoot: String
)
}
return GradleBuildRootData(importTs, projectRoots, templateClasspath, models)
return GradleBuildRootData(importTs, projectRoots, gradleHome, models)
}
private object StringsPool {

View File

@@ -19,6 +19,8 @@ abstract class GradleBuildRootsLocator {
abstract fun getScriptInfo(localPath: String): GradleScriptInfo?
fun getAllRoots(): Collection<GradleBuildRoot> = roots.list
fun getBuildRootByWorkingDir(gradleWorkingDir: String) =
roots.getBuildByRootDir(gradleWorkingDir)

View File

@@ -30,7 +30,9 @@ import org.jetbrains.kotlin.idea.scripting.gradle.roots.GradleBuildRoot.Importin
import org.jetbrains.kotlin.idea.util.application.runReadAction
import org.jetbrains.kotlin.psi.KtFile
import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstance
import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull
import org.jetbrains.plugins.gradle.config.GradleSettingsListenerAdapter
import org.jetbrains.plugins.gradle.service.GradleInstallationManager
import org.jetbrains.plugins.gradle.settings.*
import org.jetbrains.plugins.gradle.util.GradleConstants
import java.io.File
@@ -73,7 +75,7 @@ class GradleBuildRootsManager(val project: Project) : GradleBuildRootsLocator(),
if (value != field) {
field = value
roots.list.toList().forEach {
reloadBuildRoot(it.pathPrefix)
reloadBuildRoot(it.pathPrefix, null)
}
}
}
@@ -135,25 +137,31 @@ class GradleBuildRootsManager(val project: Project) : GradleBuildRootsLocator(),
}
fun markImportingInProgress(workingDir: String, inProgress: Boolean = true) {
actualizeBuildRoot(workingDir)?.importing?.set(if (inProgress) importing else updated)
actualizeBuildRoot(workingDir, null)?.importing?.set(if (inProgress) importing else updated)
updateNotifications { it.startsWith(workingDir) }
}
fun update(sync: KotlinDslGradleBuildSync) {
val oldRoot = actualizeBuildRoot(sync.workingDir, sync.gradleVersion) ?: return
// fast path for linked gradle builds without .gradle.kts support
if (sync.models.isEmpty()) {
val root = getBuildRootByWorkingDir(sync.workingDir) ?: return
if (root is Imported && root.data.models.isEmpty()) return
if (oldRoot is Imported && oldRoot.data.models.isEmpty()) return
}
val oldRoot = actualizeBuildRoot(sync.workingDir) ?: return
if (oldRoot is Legacy) return
oldRoot.importing.set(updatingCaches)
try {
if (oldRoot is Legacy) return
// TODO: can gradleHome be null, what to do in this case
val gradleHome = sync.gradleHome
if (gradleHome == null) {
scriptingInfoLog("Cannot find valid gradle home for ${sync.gradleHome} with version = ${sync.gradleVersion}, script models cannot be saved")
return
}
val templateClasspath = GradleScriptDefinitionsContributor.getDefinitionsTemplateClasspath(project)
val newData = GradleBuildRootData(sync.ts, sync.projectRoots, templateClasspath, sync.models)
val newData = GradleBuildRootData(sync.ts, sync.projectRoots, gradleHome, sync.models)
val mergedData = if (sync.failed && oldRoot is Imported) merge(oldRoot.data, newData) else newData
val lastModifiedFilesReset = LastModifiedFiles()
@@ -175,7 +183,7 @@ class GradleBuildRootsManager(val project: Project) : GradleBuildRootsLocator(),
val models = old.models.associateByTo(mutableMapOf()) { it.file }
new.models.associateByTo(models) { it.file }
return GradleBuildRootData(new.importTs, roots, new.templateClasspath, models.values)
return GradleBuildRootData(new.importTs, roots, new.gradleHome, models.values)
}
private val modifiedFilesCheckScheduled = AtomicBoolean()
@@ -206,7 +214,7 @@ class GradleBuildRootsManager(val project: Project) : GradleBuildRootsLocator(),
// detect gradle version change
val buildDir = findGradleWrapperPropertiesBuildDir(file)
if (buildDir != null) {
actualizeBuildRoot(buildDir)
actualizeBuildRoot(buildDir, null)
}
}
}
@@ -239,11 +247,12 @@ class GradleBuildRootsManager(val project: Project) : GradleBuildRootsLocator(),
}
override fun onGradleHomeChange(oldPath: String?, newPath: String?, linkedProjectPath: String) {
reloadBuildRoot(linkedProjectPath)
val version = GradleInstallationManager.getGradleVersion(newPath)
reloadBuildRoot(linkedProjectPath, version)
}
override fun onGradleDistributionTypeChange(currentValue: DistributionType?, linkedProjectPath: String) {
reloadBuildRoot(linkedProjectPath)
reloadBuildRoot(linkedProjectPath, null)
}
}
@@ -260,59 +269,69 @@ class GradleBuildRootsManager(val project: Project) : GradleBuildRootsLocator(),
* Actually this should be true, but we may miss some change events.
* For that cases we are rechecking this on each Gradle Project sync (importing/reimporting)
*/
private fun actualizeBuildRoot(workingDir: String): GradleBuildRoot? {
private fun actualizeBuildRoot(workingDir: String, gradleVersion: String?): GradleBuildRoot? {
val actualSettings = getGradleProjectSettings(workingDir)
val buildRoot = getBuildRootByWorkingDir(workingDir)
val version = gradleVersion ?: actualSettings?.let { getGradleVersion(project, it) }
return when {
buildRoot != null -> when {
!buildRoot.checkActual(actualSettings) -> reloadBuildRoot(workingDir)
else -> buildRoot
buildRoot != null -> {
when {
!buildRoot.checkActual(version) -> reloadBuildRoot(workingDir, version)
else -> buildRoot
}
}
actualSettings != null && version != null -> {
loadLinkedRoot(actualSettings, version)
}
actualSettings != null -> loadLinkedRoot(actualSettings)
else -> null
}
}
private fun GradleBuildRoot.checkActual(actualSettings: GradleProjectSettings?): Boolean {
if (actualSettings == null) return false
private fun GradleBuildRoot.checkActual(version: String?): Boolean {
if (version == null) return false
val knownAsSupported = this !is Legacy
val shouldBeSupported = kotlinDslScriptsModelImportSupported(actualSettings.resolveGradleVersion().version)
val shouldBeSupported = kotlinDslScriptsModelImportSupported(version)
return knownAsSupported == shouldBeSupported
}
private fun reloadBuildRoot(rootPath: String): GradleBuildRoot? {
private fun reloadBuildRoot(rootPath: String, version: String?): GradleBuildRoot? {
val settings = getGradleProjectSettings(rootPath)
if (settings == null) {
remove(rootPath)
return null
} else {
val newRoot = loadLinkedRoot(settings)
val gradleVersion = version ?: getGradleVersion(project, settings)
val newRoot = loadLinkedRoot(settings, gradleVersion)
add(newRoot)
return newRoot
}
}
private fun loadLinkedRoot(settings: GradleProjectSettings): GradleBuildRoot {
private fun loadLinkedRoot(settings: GradleProjectSettings, version: String = getGradleVersion(project, settings)): GradleBuildRoot {
if (!enabled) {
return Legacy(settings)
}
val supported = kotlinDslScriptsModelImportSupported(settings.resolveGradleVersion().version)
val supported = kotlinDslScriptsModelImportSupported(version)
return when {
supported -> tryLoadFromFsCache(settings) ?: New(settings)
supported -> tryLoadFromFsCache(settings, version) ?: New(settings)
else -> Legacy(settings)
}
}
private fun tryLoadFromFsCache(settings: GradleProjectSettings) =
tryCreateImportedRoot(settings.externalProjectPath) {
private fun tryLoadFromFsCache(settings: GradleProjectSettings, version: String): Imported? {
return tryCreateImportedRoot(settings.externalProjectPath) {
GradleBuildRootDataSerializer.read(it)?.let { data ->
val gradleHome = data.gradleHome
if (gradleHome.isNotBlank() && GradleInstallationManager.getGradleVersion(gradleHome) != version) return@let null
addFromSettings(data, settings)
}
}
}
private fun addFromSettings(
data: GradleBuildRootData,
@@ -326,6 +345,7 @@ class GradleBuildRootsManager(val project: Project) : GradleBuildRootsLocator(),
): Imported? {
val buildRoot = VfsUtil.findFile(Paths.get(externalProjectPath), true) ?: return null
val data = dataProvider(buildRoot) ?: return null
// TODO: can be outdated, should be taken from sync
val javaHome = ExternalSystemApiUtil
.getExecutionSettings<GradleExecutionSettings>(project, externalProjectPath, GradleConstants.SYSTEM_ID)
.javaHome?.let { File(it) }
@@ -406,7 +426,7 @@ class GradleBuildRootsManager(val project: Project) : GradleBuildRootsLocator(),
private fun updateFloatingAction(file: VirtualFile) {
if (isConfigurationOutOfDate(file)) {
scriptConfigurationsNeedToBeUpdated(project)
scriptConfigurationsNeedToBeUpdated(project, file)
} else {
scriptConfigurationsAreUpToDate(project)
}

View File

@@ -84,4 +84,8 @@ fun scriptingDebugLog(message: () -> String) {
if (logger.isDebugEnabled) {
logger.debug("[KOTLIN_GRADLE_DSL] ${message()}")
}
}
fun scriptingInfoLog(message: String) {
logger.info("[KOTLIN_GRADLE_DSL] $message")
}

View File

@@ -22,7 +22,7 @@ class GradleBuildRootDataSerializerTest {
val data = GradleBuildRootData(
123,
listOf("a", "b", "c"),
listOf("a"),
"a",
listOf(
KotlinDslScriptModel(
"a",

View File

@@ -39,7 +39,7 @@ open class AbstractGradleBuildRootsLocatorTest {
GradleBuildRootData(
ts,
relativeProjectRoots.map { (pathPrefix + it).removeSuffix("/") },
listOf(),
"",
listOf()
),
LastModifiedFiles()

View File

@@ -13,6 +13,9 @@ dependencies {
compileOnly(intellijCoreDep())
compileOnly(intellijDep())
compileOnly(intellijPluginDep("gradle"))
Platform[193].orHigher {
compileOnly(intellijPluginDep("gradle-java"))
}
testImplementation(projectTests(":idea"))
testImplementation(project(":libraries:tools:new-project-wizard:new-project-wizard-cli"))
@@ -23,7 +26,7 @@ dependencies {
testImplementation(intellijDep())
testImplementation(intellijPluginDep("gradle"))
testImplementation(projectTests(":idea:idea-gradle"))
testRuntimeOnly(toolsJar())
testRuntimeOnly(project(":plugins:kapt3-idea"))
@@ -44,9 +47,9 @@ dependencies {
}
Platform[192].orHigher {
compileOnly(intellijPluginDep("java")) { includeJars("java-api", "java-impl") }
testCompileOnly(intellijPluginDep("java")) { includeJars("java-api", "java-impl") }
testRuntimeOnly(intellijPluginDep("java")) { includeJars("java-api") }
compileOnly(intellijPluginDep("java"))
testCompileOnly(intellijPluginDep("java"))
testRuntimeOnly(intellijPluginDep("java"))
}
}

View File

@@ -6,11 +6,23 @@
package org.jetbrains.kotlin.tools.projectWizard.wizard
import com.intellij.openapi.application.impl.ApplicationInfoImpl
import com.intellij.openapi.components.service
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil
import com.intellij.openapi.projectRoots.JavaSdk
import com.intellij.openapi.projectRoots.JavaSdkType
import com.intellij.openapi.projectRoots.ProjectJdkTable
import com.intellij.openapi.projectRoots.SimpleJavaSdkType
import com.intellij.openapi.projectRoots.impl.SdkConfigurationUtil
import com.intellij.openapi.vfs.LocalFileSystem
import com.intellij.testFramework.IdeaTestUtil
import com.intellij.testFramework.PlatformTestCase
import org.jetbrains.kotlin.diagnostics.Severity
import org.jetbrains.kotlin.diagnostics.rendering.DefaultErrorMessages
import org.jetbrains.kotlin.idea.caches.resolve.analyzeWithContent
import org.jetbrains.kotlin.idea.codeInsight.gradle.ExternalSystemImportingTestCase
import org.jetbrains.kotlin.idea.core.script.ScriptConfigurationManager
import org.jetbrains.kotlin.idea.core.script.configuration.utils.getKtFile
import org.jetbrains.kotlin.idea.scripting.gradle.getGradleProjectSettings
import org.jetbrains.kotlin.idea.test.KotlinSdkCreationChecker
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase
import org.jetbrains.kotlin.test.testFramework.runWriteAction
@@ -27,6 +39,7 @@ import org.jetbrains.plugins.gradle.settings.GradleProjectSettings
import org.jetbrains.plugins.gradle.settings.GradleSettings
import org.jetbrains.plugins.gradle.util.GradleConstants
import org.jetbrains.plugins.gradle.util.GradleEnvironment
import java.io.File
import java.nio.file.Files
import java.nio.file.Path
import java.nio.file.Paths
@@ -40,8 +53,9 @@ abstract class AbstractNewWizardProjectImportTest : PlatformTestCase() {
override fun setUp() {
super.setUp()
runWriteAction {
val sdk = SimpleJavaSdkType().createJdk(SDK_NAME, IdeaTestUtil.requireRealJdkHome())
PluginTestCaseBase.addJdk(testRootDisposable, { sdk })
PluginTestCaseBase.addJdk(testRootDisposable) {
JavaSdk.getInstance().createJdk(SDK_NAME, IdeaTestUtil.requireRealJdkHome(), false)
}
}
sdkCreationChecker = KotlinSdkCreationChecker()
}
@@ -56,6 +70,7 @@ abstract class AbstractNewWizardProjectImportTest : PlatformTestCase() {
fun doTestGradleKts(directoryPath: String) {
doTest(directoryPath, BuildSystem.GRADLE_KOTLIN_DSL)
checkScriptConfigurationsIfAny()
}
fun doTestGradleGroovy(directoryPath: String) {
@@ -77,6 +92,14 @@ abstract class AbstractNewWizardProjectImportTest : PlatformTestCase() {
prepareGradleBuildSystem(tempDirectory)
}
runWizard(directory, buildSystem, tempDirectory)
}
protected fun runWizard(
directory: Path,
buildSystem: BuildSystem,
tempDirectory: Path
) {
val wizard = createWizard(directory, buildSystem, tempDirectory)
val projectDependentServices =
@@ -86,7 +109,10 @@ abstract class AbstractNewWizardProjectImportTest : PlatformTestCase() {
wizard.apply(projectDependentServices, GenerationPhase.ALL).assertSuccess()
}
protected fun prepareGradleBuildSystem(directory: Path) {
protected fun prepareGradleBuildSystem(
directory: Path,
distributionTypeSettings: DistributionType = DistributionType.WRAPPED
) {
com.intellij.openapi.components.ServiceManager.getService(project, GradleSettings::class.java)?.apply {
isOfflineWork = GradleEnvironment.Headless.GRADLE_OFFLINE?.toBoolean() ?: isOfflineWork
serviceDirectoryPath = GradleEnvironment.Headless.GRADLE_SERVICE_DIRECTORY ?: serviceDirectoryPath
@@ -99,12 +125,36 @@ abstract class AbstractNewWizardProjectImportTest : PlatformTestCase() {
isUseAutoImport = false
isUseQualifiedModuleNames = true
gradleJvm = SDK_NAME
distributionType = DistributionType.WRAPPED
distributionType = distributionTypeSettings
}
ExternalSystemApiUtil.getSettings(project, GradleConstants.SYSTEM_ID).linkProject(settings)
}
}
protected fun checkScriptConfigurationsIfAny() {
if (is192()) return
val settings = getGradleProjectSettings(project).firstOrNull() ?: error("Cannot find linked gradle project: ${project.basePath}")
val scripts = File(settings.externalProjectPath).walkTopDown().filter {
it.name.endsWith("gradle.kts")
}
scripts.forEach {
val virtualFile = LocalFileSystem.getInstance().refreshAndFindFileByIoFile(it)!!
val psiFile = project.getKtFile(virtualFile) ?: error("Cannot find KtFile for $it")
assertTrue(
"Configuration for ${it.path} is missing",
project.service<ScriptConfigurationManager>().hasConfiguration(psiFile)
)
val bindingContext = psiFile.analyzeWithContent()
val diagnostics = bindingContext.diagnostics.filter { it.severity == Severity.ERROR }
assert(diagnostics.isEmpty()) {
"Diagnostics list should be empty:\n ${diagnostics.joinToString("\n") { DefaultErrorMessages.render(it) }}"
}
}
}
private fun is192() =
ApplicationInfoImpl.getShadowInstance().minorVersionMainPart == "2"
&& ApplicationInfoImpl.getShadowInstance().majorVersion == "2019"

View File

@@ -0,0 +1,41 @@
/*
* Copyright 2010-2020 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.tools.projectWizard.wizard
import org.jetbrains.kotlin.tools.projectWizard.cli.BuildSystem
import org.jetbrains.plugins.gradle.settings.DistributionType
import org.junit.Test
import java.nio.file.Files
import java.nio.file.Paths
class ScriptHighlightingGradleDistributionTypeTest : AbstractProjectTemplateNewWizardProjectImportTest() {
@Test
fun testScriptHighlightingGradleWrapped() {
doTest(DistributionType.WRAPPED)
}
@Test
fun testScriptHighlightingGradleDefaultWrapped() {
doTest(DistributionType.DEFAULT_WRAPPED)
}
@Test
fun testScriptHighlightingGradleBundled() {
doTest(DistributionType.BUNDLED)
}
private fun doTest(distributionType: DistributionType) {
val directory = Paths.get("backendApplication")
val tempDirectory = Files.createTempDirectory(null)
prepareGradleBuildSystem(tempDirectory, distributionType)
runWizard(directory, BuildSystem.GRADLE_KOTLIN_DSL, tempDirectory)
checkScriptConfigurationsIfAny()
}
}

View File

@@ -21,7 +21,6 @@ import org.jetbrains.kotlin.idea.debugger.stepping.KotlinSteppingConfigurableUi
class KotlinDebuggerSettings : XDebuggerSettings<KotlinDebuggerSettings>("kotlin_debugger"), Getter<KotlinDebuggerSettings> {
var renderDelegatedProperties: Boolean = false
var disableKotlinInternalClasses: Boolean = true
var isFilterForStdlibAlreadyAdded: Boolean = false
var debugDisableCoroutineAgent: Boolean = false
companion object {

View File

@@ -18,18 +18,17 @@ package org.jetbrains.kotlin.idea.debugger.filter
import com.intellij.debugger.settings.DebuggerSettings
import com.intellij.ui.classFilter.ClassFilter
import org.jetbrains.kotlin.idea.debugger.KotlinDebuggerSettings
private const val KOTLIN_STDLIB_FILTER = "kotlin.*"
fun addKotlinStdlibDebugFilterIfNeeded() {
if (!KotlinDebuggerSettings.getInstance().isFilterForStdlibAlreadyAdded) {
val settings = DebuggerSettings.getInstance()!!
val newFilters = (settings.steppingFilters + ClassFilter(KOTLIN_STDLIB_FILTER))
val settings = DebuggerSettings.getInstance() ?: return
val existingFilters = settings.steppingFilters
settings.steppingFilters = newFilters
KotlinDebuggerSettings.getInstance().isFilterForStdlibAlreadyAdded = true
if (existingFilters.any { it.pattern == KOTLIN_STDLIB_FILTER }) {
return
}
settings.steppingFilters = settings.steppingFilters + ClassFilter(KOTLIN_STDLIB_FILTER)
}

View File

@@ -32,7 +32,6 @@ internal object DebuggerPreferenceKeys {
val DISABLE_KOTLIN_INTERNAL_CLASSES by debuggerPreferenceKey(false)
val RENDER_DELEGATED_PROPERTIES by debuggerPreferenceKey(false)
val IS_FILTER_FOR_STDLIB_ALREADY_ADDED by debuggerPreferenceKey(false)
val FORCE_RANKING by debuggerPreferenceKey(false)

View File

@@ -12,7 +12,6 @@ import org.jetbrains.kotlin.idea.debugger.DebuggerUtils
import org.jetbrains.kotlin.idea.debugger.KotlinDebuggerSettings
import org.jetbrains.kotlin.idea.debugger.ToggleKotlinVariablesState
import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferenceKeys.DISABLE_KOTLIN_INTERNAL_CLASSES
import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferenceKeys.IS_FILTER_FOR_STDLIB_ALREADY_ADDED
import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferenceKeys.RENDER_DELEGATED_PROPERTIES
import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferenceKeys.SKIP_CLASSLOADERS
import org.jetbrains.kotlin.idea.debugger.test.preference.DebuggerPreferenceKeys.SKIP_CONSTRUCTORS
@@ -29,7 +28,6 @@ internal val SettingsMutators: List<SettingsMutator<*>> = listOf(
DebuggerSettingsMutator(SKIP_GETTERS, DebuggerSettings::SKIP_GETTERS),
KotlinSettingsMutator(DISABLE_KOTLIN_INTERNAL_CLASSES, KotlinDebuggerSettings::disableKotlinInternalClasses),
KotlinSettingsMutator(RENDER_DELEGATED_PROPERTIES, KotlinDebuggerSettings::renderDelegatedProperties),
KotlinSettingsMutator(IS_FILTER_FOR_STDLIB_ALREADY_ADDED, KotlinDebuggerSettings::isFilterForStdlibAlreadyAdded),
KotlinVariablesModeSettingsMutator,
JvmTargetSettingsMutator,
ForceRankingSettingsMutator

View File

@@ -11,7 +11,7 @@ CoroutineInfo: 1 coroutine RUNNING
CoroutineStackFrame a:!LINE_NUMBER!, CoroutineSuspendFunKt (continuation)
(a)
CoroutineStackFrame invokeSuspend:!LINE_NUMBER!, CoroutineSuspendFunKt$main$1 (continuation)
($this$runBlocking)
()
CoroutineStackFrame resumeWith:!LINE_NUMBER!, BaseContinuationImpl (kotlin.coroutines.jvm.internal)
($i$a$-with-BaseContinuationImpl$resumeWith$1, $this$with, completion, current, param, result, this)
CoroutineStackFrame run:!LINE_NUMBER!, DispatchedTask (kotlinx.coroutines)

View File

@@ -11,7 +11,7 @@ CoroutineInfo: 1 coroutine RUNNING
CoroutineStackFrame a:!LINE_NUMBER!, CoroutineSuspendFun136Kt (continuation)
(a)
CoroutineStackFrame invokeSuspend:!LINE_NUMBER!, CoroutineSuspendFun136Kt$main$1 (continuation)
($this$runBlocking)
()
CoroutineStackFrame resumeWith:!LINE_NUMBER!, BaseContinuationImpl (kotlin.coroutines.jvm.internal)
($i$a$-with-BaseContinuationImpl$resumeWith$1, $this$with, completion, current, param, result, this)
CoroutineStackFrame run:!LINE_NUMBER!, DispatchedTask (kotlinx.coroutines)

View File

@@ -36,6 +36,7 @@ import org.jetbrains.kotlin.idea.kdoc.KDocTemplate.DescriptionBodyTemplate
import org.jetbrains.kotlin.idea.references.KtDescriptorsBasedReference
import org.jetbrains.kotlin.idea.references.resolveToDescriptors
import org.jetbrains.kotlin.idea.references.mainReference
import org.jetbrains.kotlin.idea.resolve.ResolutionFacade
import org.jetbrains.kotlin.idea.resolve.frontendService
import org.jetbrains.kotlin.idea.util.isRunningInCidrIde
import org.jetbrains.kotlin.js.resolve.diagnostics.findPsi
@@ -142,10 +143,11 @@ open class KotlinDocumentationProviderCompatBase : AbstractDocumentationProvider
override fun getDocumentationElementForLink(psiManager: PsiManager, link: String, context: PsiElement?): PsiElement? {
val navElement = context?.navigationElement as? KtElement ?: return null
val bindingContext = navElement.analyze(BodyResolveMode.PARTIAL)
val resolutionFacade = navElement.getResolutionFacade()
val bindingContext = navElement.analyze(resolutionFacade, BodyResolveMode.PARTIAL)
val contextDescriptor = bindingContext[BindingContext.DECLARATION_TO_DESCRIPTOR, navElement] ?: return null
val descriptors = resolveKDocLink(
bindingContext, navElement.getResolutionFacade(),
bindingContext, resolutionFacade,
contextDescriptor, null, link.split('.')
)
val target = descriptors.firstOrNull() ?: return null
@@ -318,7 +320,8 @@ open class KotlinDocumentationProviderCompatBase : AbstractDocumentationProvider
}
private fun buildKotlinDeclaration(declaration: KtExpression, quickNavigation: Boolean): KDocTemplate {
val context = declaration.analyze(BodyResolveMode.PARTIAL)
val resolutionFacade = declaration.getResolutionFacade()
val context = declaration.analyze(resolutionFacade, BodyResolveMode.PARTIAL)
val declarationDescriptor = context[BindingContext.DECLARATION_TO_DESCRIPTOR, declaration]
if (declarationDescriptor == null) {
@@ -330,29 +333,32 @@ open class KotlinDocumentationProviderCompatBase : AbstractDocumentationProvider
}
}
return buildKotlin(context, declarationDescriptor, quickNavigation, declaration)
return buildKotlin(context, declarationDescriptor, quickNavigation, declaration, resolutionFacade)
}
private fun renderKotlinImplicitLambdaParameter(element: KtReferenceExpression, quickNavigation: Boolean): String? {
val context = element.analyze(BodyResolveMode.PARTIAL)
val resolutionFacade = element.getResolutionFacade()
val context = element.analyze(resolutionFacade, BodyResolveMode.PARTIAL)
val target = element.mainReference.resolveToDescriptors(context).singleOrNull() as? ValueParameterDescriptor? ?: return null
return renderKotlin(context, target, quickNavigation, element)
return renderKotlin(context, target, quickNavigation, element, resolutionFacade)
}
private fun renderKotlin(
context: BindingContext,
declarationDescriptor: DeclarationDescriptor,
quickNavigation: Boolean,
ktElement: KtElement
ktElement: KtElement,
resolutionFacade: ResolutionFacade,
) = buildString {
insert(buildKotlin(context, declarationDescriptor, quickNavigation, ktElement)) {}
insert(buildKotlin(context, declarationDescriptor, quickNavigation, ktElement, resolutionFacade)) {}
}
private fun buildKotlin(
context: BindingContext,
declarationDescriptor: DeclarationDescriptor,
quickNavigation: Boolean,
ktElement: KtElement
ktElement: KtElement,
resolutionFacade: ResolutionFacade,
): KDocTemplate {
@Suppress("NAME_SHADOWING")
var declarationDescriptor = declarationDescriptor
@@ -363,7 +369,7 @@ open class KotlinDocumentationProviderCompatBase : AbstractDocumentationProvider
}
}
val deprecationProvider = ktElement.getResolutionFacade().frontendService<DeprecationResolver>()
val deprecationProvider = resolutionFacade.frontendService<DeprecationResolver>()
return KDocTemplate().apply {
definition {

View File

@@ -58,7 +58,7 @@ class ConflictingExtensionPropertyInspection : AbstractKotlinInspection() {
return propertyVisitor(fun(property: KtProperty) {
if (property.receiverTypeReference != null) {
val nameElement = property.nameIdentifier ?: return
val propertyDescriptor = property.resolveToDescriptorIfAny() as? PropertyDescriptor ?: return
val propertyDescriptor = property.resolveToDescriptorIfAny(resolutionFacade) as? PropertyDescriptor ?: return
val syntheticScopes = resolutionFacade.frontendService<SyntheticScopes>()
val conflictingExtension = conflictingSyntheticExtension(propertyDescriptor, syntheticScopes) ?: return

View File

@@ -35,9 +35,10 @@ class OverridingDeprecatedMemberInspection : AbstractKotlinInspection() {
}
private fun registerProblemIfNeeded(declaration: KtDeclaration, targetForProblem: PsiElement) {
val accessorDescriptor = declaration.resolveToDescriptorIfAny() as? CallableMemberDescriptor ?: return
val resolutionFacade = declaration.getResolutionFacade()
val accessorDescriptor = declaration.resolveToDescriptorIfAny(resolutionFacade) as? CallableMemberDescriptor ?: return
val deprecationProvider = declaration.getResolutionFacade().frontendService<DeprecationResolver>()
val deprecationProvider = resolutionFacade.frontendService<DeprecationResolver>()
val message = deprecationProvider.getDeprecations(accessorDescriptor)
.firstOrNull()

View File

@@ -320,20 +320,21 @@ abstract class AbstractLookupTrackerTest : TestWithWorkingDir() {
val end = column - 1
parts.add(lineContent.subSequence(start, end))
val lookups = lookupsFromColumn.distinct().joinToString(separator = " ", prefix = "/*", postfix = "*/") {
val lookups = lookupsFromColumn.mapTo(sortedSetOf()) {
val rest = lineContent.substring(end)
val name =
when {
rest.startsWith(it.name) || // same name
rest.startsWith("$" + it.name) || // backing field
DECLARATION_STARTS_WITH.any { rest.startsWith(it) } // it's declaration
-> ""
else -> "(" + it.name + ")"
}
when {
rest.startsWith(it.name) || // same name
rest.startsWith("$" + it.name) || // backing field
DECLARATION_STARTS_WITH.any { rest.startsWith(it) } // it's declaration
-> ""
else -> "(" + it.name + ")"
}
it.scopeKind.toString()[0].toLowerCase().toString() + ":" + it.scopeFqName.let { if (it.isNotEmpty()) it else "<root>" } + name
}
it.scopeKind.toString()[0].toLowerCase()
.toString() + ":" + it.scopeFqName.let { if (it.isNotEmpty()) it else "<root>" } + name
}.joinToString(separator = " ", prefix = "/*", postfix = "*/")
parts.add(lookups)

View File

@@ -2,6 +2,6 @@ package foo
import bar.*
/*p:foo*/fun <T : /*p:foo*/A?, B : /*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Iterable</*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Number>, C, D> test()
where C : /*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Number, C : /*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Comparable</*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Number>, D : B
/*p:foo*/fun <T : /*p:foo*/A?, B : /*p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Iterable</*p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Number>, C, D> test()
where C : /*p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Number, C : /*p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Comparable</*p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Number>, D : B
{}

View File

@@ -6,10 +6,10 @@ import bar.*
val a = /*p:kotlin(Int)*/1
var b = /*p:kotlin(String)*/""
val c: /*c:foo.A c:foo.A.Companion p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/String
val c: /*c:foo.A c:foo.A.Companion p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/String
get() = /*c:foo.A p:kotlin(String)*/b
var d: /*c:foo.A c:foo.A.Companion p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/String = /*p:kotlin(String)*/"ddd"
var d: /*c:foo.A c:foo.A.Companion p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/String = /*p:kotlin(String)*/"ddd"
get() = /*p:kotlin(String)*/field
set(v) { /*p:kotlin(String)*/field = /*p:kotlin(String)*/v }
@@ -18,16 +18,16 @@ import bar.*
/*c:foo.A*/foo()
/*p:foo(A) p:kotlin(Int)*/this./*c:foo.A*/a
/*p:foo(A)*/this./*c:foo.A*/foo()
/*c:foo.A c:foo.A.Companion p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/baz()
/*c:foo.A c:foo.A.Companion p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js p:kotlin(Int)*/Companion./*c:foo.A.Companion*/a
/*c:foo.A c:foo.A.Companion p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js p:kotlin(String)*/O./*c:foo.A.O*/v = /*p:kotlin(String)*/"OK"
/*c:foo.A c:foo.A.Companion p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/baz()
/*c:foo.A c:foo.A.Companion p:bar p:foo p:kotlin p:kotlin(Int) p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Companion./*c:foo.A.Companion*/a
/*c:foo.A c:foo.A.Companion p:bar p:foo p:kotlin p:kotlin(String) p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/O./*c:foo.A.O*/v = /*p:kotlin(String)*/"OK"
}
class B {
val a = /*p:kotlin(Int)*/1
companion object CO {
fun bar(a: /*c:foo.A.B.CO c:foo.A.B c:foo.A c:foo.A.Companion p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Int) {}
fun bar(a: /*c:foo.A c:foo.A.B c:foo.A.B.CO c:foo.A.Companion p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Int) {}
}
}
@@ -44,7 +44,7 @@ import bar.*
}
/*p:foo*/interface I {
var a: /*c:foo.I p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Int
var a: /*c:foo.I p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Int
fun foo()
class NI
@@ -54,7 +54,7 @@ import bar.*
override var a = /*p:kotlin(Int)*/1
override fun foo() {}
val b = /*p:kotlin(Int)*/1
fun bar(): /*c:foo.Obj p:foo*/I = /*p:kotlin(Nothing) p:foo(I)*/null as /*c:foo.Obj p:foo*/I
fun bar(): /*c:foo.Obj p:foo*/I = /*p:foo(I) p:kotlin(Nothing)*/null as /*c:foo.Obj p:foo*/I
}
/*p:foo*/enum class E {
@@ -64,8 +64,8 @@ import bar.*
val a = /*p:kotlin(Int)*/1
fun foo() {
/*c:foo.E p:kotlin(Int)*/a
/*c:foo.E p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js p:kotlin(Int)*/Y./*c:foo.E*/a
/*c:foo.E p:bar p:foo p:kotlin p:kotlin(Int) p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Y./*c:foo.E*/a
/*c:foo.E*/foo()
/*c:foo.E p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/X./*c:foo.E*/foo()
/*c:foo.E p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/X./*c:foo.E*/foo()
}
}

View File

@@ -3,20 +3,20 @@ package foo
import bar.*
/*p:foo*/fun usages(i: /*p:foo*/I) /*p:foo(E)*/{
/*p:foo c:foo.A.Companion(invoke) p:foo(invoke) p:kotlin(Int)*/A()./*c:foo.A*/a
/*p:foo c:foo.A.Companion(invoke) p:foo(invoke) p:kotlin(String)*/A()./*c:foo.A*/b
/*p:foo c:foo.A.Companion(invoke) p:foo(invoke) p:kotlin(String)*/A()./*c:foo.A*/c
/*p:foo c:foo.A.Companion(invoke) p:foo(invoke) p:kotlin(String)*/A()./*c:foo.A*/d = /*p:kotlin(String)*/"new value"
/*p:foo c:foo.A.Companion(invoke) p:foo(invoke)*/A()./*c:foo.A*/foo()
/*p:foo p:kotlin(Int)*/A./*c:foo.A c:foo.A.Companion c:foo.A.B.CO(invoke)*/B()./*c:foo.A.B*/a
/*c:foo.A.Companion(invoke) p:foo p:foo(invoke) p:kotlin(Int)*/A()./*c:foo.A*/a
/*c:foo.A.Companion(invoke) p:foo p:foo(invoke) p:kotlin(String)*/A()./*c:foo.A*/b
/*c:foo.A.Companion(invoke) p:foo p:foo(invoke) p:kotlin(String)*/A()./*c:foo.A*/c
/*c:foo.A.Companion(invoke) p:foo p:foo(invoke) p:kotlin(String)*/A()./*c:foo.A*/d = /*p:kotlin(String)*/"new value"
/*c:foo.A.Companion(invoke) p:foo p:foo(invoke)*/A()./*c:foo.A*/foo()
/*p:foo p:kotlin(Int)*/A./*c:foo.A c:foo.A.B.CO(invoke) c:foo.A.Companion*/B()./*c:foo.A.B*/a
/*p:foo*/A./*c:foo.A*/B./*c:foo.A.B c:foo.A.B.CO*/bar(1)
/*p:foo*/A./*c:foo.A*/B./*c:foo.A.B*/CO./*c:foo.A.B.CO*/bar(1)
/*p:foo c:foo.A(Companion)*/A
/*p:foo p:kotlin(Int)*/A./*c:foo.A.Companion c:foo.A*/a
/*c:foo.A(Companion) p:foo*/A
/*p:foo p:kotlin(Int)*/A./*c:foo.A c:foo.A.Companion*/a
/*p:foo*/A./*c:foo.A c:foo.A.Companion*/baz()
/*p:foo c:foo.A(Companion)*/A./*c:foo.A.Companion c:foo.A*/Companion
/*c:foo.A(Companion) p:foo*/A./*c:foo.A c:foo.A.Companion*/Companion
/*p:foo*/A./*c:foo.A*/Companion./*c:foo.A.Companion*/baz()
/*p:foo c:foo.A(O)*/A./*c:foo.A.Companion c:foo.A*/O
/*c:foo.A(O) p:foo*/A./*c:foo.A c:foo.A.Companion*/O
/*p:foo p:kotlin(String)*/A./*c:foo.A*/O./*c:foo.A.O*/v = /*p:kotlin(String)*/"OK"
/*p:foo(I) p:kotlin(Int)*/i./*c:foo.I*/a = /*p:kotlin(Int)*/2
@@ -29,11 +29,11 @@ import bar.*
val iii = /*p:foo p:foo(I)*/Obj./*c:foo.Obj*/bar()
/*p:foo(I)*/iii./*c:foo.I*/foo()
/*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/E./*c:foo.E*/X
/*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js p:kotlin(Int)*/E./*c:foo.E*/X./*c:foo.E*/a
/*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/E./*c:foo.E*/Y./*c:foo.E*/foo()
/*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js p:kotlin(Array)*/E./*c:foo.E*/values()
/*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/E./*c:foo.E*/valueOf(/*p:kotlin(String)*/"")
/*p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/E./*c:foo.E*/X
/*p:bar p:foo p:kotlin p:kotlin(Int) p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/E./*c:foo.E*/X./*c:foo.E*/a
/*p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/E./*c:foo.E*/Y./*c:foo.E*/foo()
/*p:bar p:foo p:kotlin p:kotlin(Array) p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/E./*c:foo.E*/values()
/*p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/E./*c:foo.E*/valueOf(/*p:kotlin(String)*/"")
}
/*p:foo*/fun classifiers(

View File

@@ -3,23 +3,23 @@ package foo
import bar.*
/*p:foo*/fun usages(i: /*p:foo*/I) {
/*p:foo c:foo.A.Companion(invoke) p:foo(invoke) p:kotlin(Int)*/A()./*c:foo.A*/a
/*p:foo c:foo.A.Companion(invoke) p:foo(invoke) p:kotlin(String)*/A()./*c:foo.A*/b
/*p:foo c:foo.A.Companion(invoke) p:foo(invoke) p:kotlin(String)*/A()./*c:foo.A*/c
/*p:foo c:foo.A.Companion(invoke) p:foo(invoke) p:kotlin(String)*/A()./*c:foo.A*/d = /*p:kotlin(String)*/"new value"
/*p:foo c:foo.A.Companion(invoke) p:foo(invoke)*/A()./*c:foo.A*/foo()
/*p:foo p:kotlin(Int)*/A./*c:foo.A c:foo.A.Companion c:foo.A.B.CO(invoke)*/B()./*c:foo.A.B*/a
/*c:foo.A.Companion(invoke) p:foo p:foo(invoke) p:kotlin(Int)*/A()./*c:foo.A*/a
/*c:foo.A.Companion(invoke) p:foo p:foo(invoke) p:kotlin(String)*/A()./*c:foo.A*/b
/*c:foo.A.Companion(invoke) p:foo p:foo(invoke) p:kotlin(String)*/A()./*c:foo.A*/c
/*c:foo.A.Companion(invoke) p:foo p:foo(invoke) p:kotlin(String)*/A()./*c:foo.A*/d = /*p:kotlin(String)*/"new value"
/*c:foo.A.Companion(invoke) p:foo p:foo(invoke)*/A()./*c:foo.A*/foo()
/*p:foo p:kotlin(Int)*/A./*c:foo.A c:foo.A.B.CO(invoke) c:foo.A.Companion*/B()./*c:foo.A.B*/a
/*p:foo*/A./*c:foo.A*/B./*c:foo.A.B c:foo.A.B.CO*/bar(1)
/*p:foo*/A./*c:foo.A*/B./*c:foo.A.B*/CO./*c:foo.A.B.CO*/bar(1)
/*p:foo c:foo.A(Companion)*/A
/*p:foo p:kotlin(Int)*/A./*c:foo.A.Companion c:foo.A*/a
/*c:foo.A(Companion) p:foo*/A
/*p:foo p:kotlin(Int)*/A./*c:foo.A c:foo.A.Companion*/a
/*p:foo*/A./*c:foo.A c:foo.A.Companion*/baz()
/*p:foo c:foo.A(Companion)*/A./*c:foo.A.Companion c:foo.A*/Companion
/*c:foo.A(Companion) p:foo*/A./*c:foo.A c:foo.A.Companion*/Companion
/*p:foo*/A./*c:foo.A*/Companion./*c:foo.A.Companion*/baz()
/*p:foo c:foo.A(O)*/A./*c:foo.A.Companion c:foo.A*/O
/*c:foo.A(O) p:foo*/A./*c:foo.A c:foo.A.Companion*/O
/*p:foo p:kotlin(String)*/A./*c:foo.A*/O./*c:foo.A.O*/v = /*p:kotlin(String)*/"OK"
/*p:foo*/A./*c:foo.A.Companion c:foo.A p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/vala
/*p:foo*/A./*c:foo.A c:foo.A.Companion p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/vara()
/*p:foo*/A./*c:foo.A c:foo.A.Companion p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/vala
/*p:foo*/A./*c:foo.A c:foo.A.Companion p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/vara()
/*p:foo(I) p:kotlin(Int)*/i./*c:foo.I*/a = /*p:kotlin(Int)*/2
/*p:foo p:kotlin(Int)*/Obj./*c:foo.Obj*/a
@@ -31,13 +31,13 @@ import bar.*
val iii = /*p:foo p:foo(I)*/Obj./*c:foo.Obj*/bar()
/*p:foo(I)*/iii./*c:foo.I*/foo()
/*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/E./*c:foo.E*/X
/*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js p:kotlin(Int)*/E./*c:foo.E*/X./*c:foo.E*/a
/*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/E./*c:foo.E*/Y./*c:foo.E*/foo()
/*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js p:kotlin(Array)*/E./*c:foo.E*/values()
/*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/E./*c:foo.E*/valueOf(/*p:kotlin(String)*/"")
/*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/E./*c:foo.E*/foo
/*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/E./*c:foo.E*/bar()
/*p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/E./*c:foo.E*/X
/*p:bar p:foo p:kotlin p:kotlin(Int) p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/E./*c:foo.E*/X./*c:foo.E*/a
/*p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/E./*c:foo.E*/Y./*c:foo.E*/foo()
/*p:bar p:foo p:kotlin p:kotlin(Array) p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/E./*c:foo.E*/values()
/*p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/E./*c:foo.E*/valueOf(/*p:kotlin(String)*/"")
/*p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/E./*c:foo.E*/foo
/*p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/E./*c:foo.E*/bar()
}
/*p:foo*/fun classifiers(

View File

@@ -1,6 +1,6 @@
package foo.bar
/*p:foo.bar*/fun testComparisons(a: /*p:foo.bar*/A, b: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Int, c: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Any, na: /*p:foo.bar*/A?) /*p:kotlin(Boolean)*/{
/*p:foo.bar*/fun testComparisons(a: /*p:foo.bar*/A, b: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Int, c: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Any, na: /*p:foo.bar*/A?) /*p:kotlin(Boolean)*/{
/*p:foo.bar(A) p:kotlin(Boolean)*/a /*c:foo.bar.A(equals)*/== /*p:kotlin(Any)*/c
/*p:foo.bar(A) p:kotlin(Boolean)*/a /*c:foo.bar.A(equals)*/!= /*p:kotlin(Any)*/c
/*p:foo.bar(A) p:kotlin(Boolean)*/na /*c:foo.bar.A(equals)*/== /*p:foo.bar(A)*/a

View File

@@ -1,15 +1,15 @@
package foo.bar
/*p:foo.bar*/class A {
operator fun plus(a: /*c:foo.bar.A p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Int) = /*p:foo.bar(A)*/this
operator fun timesAssign(a: /*c:foo.bar.A p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Any?) {}
operator fun plus(a: /*c:foo.bar.A p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Int) = /*p:foo.bar(A)*/this
operator fun timesAssign(a: /*c:foo.bar.A p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Any?) {}
operator fun inc(): /*c:foo.bar.A p:foo.bar*/A = /*p:foo.bar(A)*/this
operator fun get(i: /*c:foo.bar.A p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Int) = /*p:kotlin(Int)*/1
operator fun contains(a: /*c:foo.bar.A p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Int): /*c:foo.bar.A p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Boolean = /*p:kotlin(Boolean)*/false
operator fun get(i: /*c:foo.bar.A p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Int) = /*p:kotlin(Int)*/1
operator fun contains(a: /*c:foo.bar.A p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Int): /*c:foo.bar.A p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Boolean = /*p:kotlin(Boolean)*/false
operator fun invoke() {}
operator fun compareTo(a: /*c:foo.bar.A p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Int) = /*p:kotlin(Int)*/0
operator fun compareTo(a: /*c:foo.bar.A p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Int) = /*p:kotlin(Int)*/0
operator fun component1() = /*p:foo.bar(A)*/this
@@ -17,19 +17,19 @@ package foo.bar
operator fun next() = /*p:foo.bar(A)*/this
}
/*p:foo.bar*/operator fun /*p:foo.bar*/A.minus(a: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Int) = /*p:foo.bar(A)*/this
/*p:foo.bar*/operator fun /*p:foo.bar*/A.divAssign(a: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Any?) {}
/*p:foo.bar*/operator fun /*p:foo.bar*/A.minus(a: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Int) = /*p:foo.bar(A)*/this
/*p:foo.bar*/operator fun /*p:foo.bar*/A.divAssign(a: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Any?) {}
/*p:foo.bar*/operator fun /*p:foo.bar*/A.dec(): /*p:foo.bar*/A = /*p:foo.bar(A)*/this
/*p:foo.bar*/operator fun /*p:foo.bar*/A.not() {}
/*p:foo.bar*/operator fun /*p:foo.bar*/A.set(i: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Int, v: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Int) {}
/*p:foo.bar*/operator fun /*p:foo.bar*/A.contains(a: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Any): /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Boolean = /*p:kotlin(Boolean)*/true
/*p:foo.bar*/operator fun /*p:foo.bar*/A.invoke(i: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Int) {}
/*p:foo.bar*/operator fun /*p:foo.bar*/A.set(i: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Int, v: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Int) {}
/*p:foo.bar*/operator fun /*p:foo.bar*/A.contains(a: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Any): /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Boolean = /*p:kotlin(Boolean)*/true
/*p:foo.bar*/operator fun /*p:foo.bar*/A.invoke(i: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Int) {}
/*p:foo.bar*/operator fun /*p:foo.bar*/A.compareTo(a: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Any) = /*p:kotlin(Int)*/0
/*p:foo.bar*/operator fun /*p:foo.bar*/A.compareTo(a: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Any) = /*p:kotlin(Int)*/0
/*p:foo.bar*/operator fun /*p:foo.bar*/A.component2() = /*p:foo.bar(A)*/this
/*p:foo.bar*/operator fun /*p:foo.bar*/A?.iterator() = /*p:foo.bar(A)*/this!!
/*p:foo.bar*/operator fun /*p:foo.bar*/A.hasNext(): /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Boolean = /*p:kotlin(Boolean)*/false
/*p:foo.bar*/operator fun /*p:foo.bar*/A.hasNext(): /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Boolean = /*p:kotlin(Boolean)*/false

View File

@@ -3,28 +3,28 @@ package foo.bar
/*p:kotlin.reflect(KProperty)*/import kotlin.reflect.KProperty
/*p:foo.bar*/class D1 {
operator fun getValue(t: /*c:foo.bar.D1 p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Any?, p: /*c:foo.bar.D1 p:kotlin.reflect*/KProperty<*>) = /*p:kotlin(Int)*/1
operator fun getValue(t: /*c:foo.bar.D1 p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Any?, p: /*c:foo.bar.D1 p:kotlin.reflect*/KProperty<*>) = /*p:kotlin(Int)*/1
}
/*p:foo.bar*/operator fun /*p:foo.bar*/D1.setValue(t: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Any?, p: /*p:kotlin.reflect*/KProperty<*>, v: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Int) {}
/*p:foo.bar*/operator fun /*p:foo.bar*/D1.setValue(t: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Any?, p: /*p:kotlin.reflect*/KProperty<*>, v: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Int) {}
/*p:foo.bar(D2)*/open class D2 {
operator fun setValue(t: /*c:foo.bar.D2 p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Any?, p: /*c:foo.bar.D2 p:kotlin.reflect*/KProperty<*>, v: /*c:foo.bar.D2 p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Int) {}
operator fun setValue(t: /*c:foo.bar.D2 p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Any?, p: /*c:foo.bar.D2 p:kotlin.reflect*/KProperty<*>, v: /*c:foo.bar.D2 p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Int) {}
}
/*p:foo.bar*/operator fun /*p:foo.bar*/D2.getValue(t: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Any?, p: /*p:kotlin.reflect*/KProperty<*>) = /*p:kotlin(Int)*/1
/*p:foo.bar*/operator fun /*p:foo.bar*/D2.provideDelegate(p: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Any?, k: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Any) = /*p:foo.bar(D2)*/this
/*p:foo.bar*/operator fun /*p:foo.bar*/D2.getValue(t: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Any?, p: /*p:kotlin.reflect*/KProperty<*>) = /*p:kotlin(Int)*/1
/*p:foo.bar*/operator fun /*p:foo.bar*/D2.provideDelegate(p: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Any?, k: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Any) = /*p:foo.bar(D2)*/this
/*p:foo.bar*/class D3 : /*p:foo.bar*/D2() {
operator fun provideDelegate(p: /*c:foo.bar.D3 c:foo.bar.D2 p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Any?, k: /*c:foo.bar.D3 c:foo.bar.D2 p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Any) = /*p:foo.bar(D3)*/this
operator fun provideDelegate(p: /*c:foo.bar.D2 c:foo.bar.D3 p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Any?, k: /*c:foo.bar.D2 c:foo.bar.D3 p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Any) = /*p:foo.bar(D3)*/this
}
/*p:foo.bar*/val x1 by /*p:foo.bar c:foo.bar.D1(provideDelegate) p:foo.bar(provideDelegate) p:kotlin(provideDelegate) p:kotlin.annotation(provideDelegate) p:kotlin.collections(provideDelegate) p:kotlin.ranges(provideDelegate) p:kotlin.sequences(provideDelegate) p:kotlin.text(provideDelegate) p:kotlin.io(provideDelegate) p:kotlin.comparisons(provideDelegate) p:kotlin.js(provideDelegate) c:foo.bar.D1(getValue)*/D1()
/*p:foo.bar*/var y1 by /*p:foo.bar c:foo.bar.D1(provideDelegate) p:foo.bar(provideDelegate) p:kotlin(provideDelegate) p:kotlin.annotation(provideDelegate) p:kotlin.collections(provideDelegate) p:kotlin.ranges(provideDelegate) p:kotlin.sequences(provideDelegate) p:kotlin.text(provideDelegate) p:kotlin.io(provideDelegate) p:kotlin.comparisons(provideDelegate) p:kotlin.js(provideDelegate) c:foo.bar.D1(getValue) c:foo.bar.D1(setValue) p:foo.bar(setValue)*/D1()
/*p:foo.bar*/val x1 by /*c:foo.bar.D1(getValue) c:foo.bar.D1(provideDelegate) p:foo.bar p:foo.bar(provideDelegate) p:kotlin(provideDelegate) p:kotlin.annotation(provideDelegate) p:kotlin.collections(provideDelegate) p:kotlin.comparisons(provideDelegate) p:kotlin.io(provideDelegate) p:kotlin.js(provideDelegate) p:kotlin.ranges(provideDelegate) p:kotlin.sequences(provideDelegate) p:kotlin.text(provideDelegate)*/D1()
/*p:foo.bar*/var y1 by /*c:foo.bar.D1(getValue) c:foo.bar.D1(provideDelegate) c:foo.bar.D1(setValue) p:foo.bar p:foo.bar(provideDelegate) p:foo.bar(setValue) p:kotlin(provideDelegate) p:kotlin.annotation(provideDelegate) p:kotlin.collections(provideDelegate) p:kotlin.comparisons(provideDelegate) p:kotlin.io(provideDelegate) p:kotlin.js(provideDelegate) p:kotlin.ranges(provideDelegate) p:kotlin.sequences(provideDelegate) p:kotlin.text(provideDelegate)*/D1()
/*p:foo.bar*/val x2 by /*p:foo.bar c:foo.bar.D2(provideDelegate) p:foo.bar(provideDelegate) c:foo.bar.D2(getValue) p:foo.bar(getValue)*/D2()
/*p:foo.bar*/var y2 by /*p:foo.bar c:foo.bar.D2(provideDelegate) p:foo.bar(provideDelegate) c:foo.bar.D2(getValue) p:foo.bar(getValue) c:foo.bar.D2(setValue)*/D2()
/*p:foo.bar*/val x2 by /*c:foo.bar.D2(getValue) c:foo.bar.D2(provideDelegate) p:foo.bar p:foo.bar(getValue) p:foo.bar(provideDelegate)*/D2()
/*p:foo.bar*/var y2 by /*c:foo.bar.D2(getValue) c:foo.bar.D2(provideDelegate) c:foo.bar.D2(setValue) p:foo.bar p:foo.bar(getValue) p:foo.bar(provideDelegate)*/D2()
/*p:foo.bar*/val x3 by /*p:foo.bar c:foo.bar.D3(provideDelegate) c:foo.bar.D2(provideDelegate) c:foo.bar.D3(getValue) c:foo.bar.D2(getValue) p:foo.bar(getValue)*/D3()
/*p:foo.bar*/var y3 by /*p:foo.bar c:foo.bar.D3(provideDelegate) c:foo.bar.D2(provideDelegate) c:foo.bar.D3(getValue) c:foo.bar.D2(getValue) p:foo.bar(getValue) c:foo.bar.D3(setValue) c:foo.bar.D2(setValue)*/D3()
/*p:foo.bar*/val x3 by /*c:foo.bar.D2(getValue) c:foo.bar.D2(provideDelegate) c:foo.bar.D3(getValue) c:foo.bar.D3(provideDelegate) p:foo.bar p:foo.bar(getValue)*/D3()
/*p:foo.bar*/var y3 by /*c:foo.bar.D2(getValue) c:foo.bar.D2(provideDelegate) c:foo.bar.D2(setValue) c:foo.bar.D3(getValue) c:foo.bar.D3(provideDelegate) c:foo.bar.D3(setValue) p:foo.bar p:foo.bar(getValue)*/D3()

View File

@@ -1,12 +1,12 @@
package foo.bar
/*p:foo.bar*/fun testOperators(a: /*p:foo.bar*/A, b: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Int) {
/*p:foo.bar*/fun testOperators(a: /*p:foo.bar*/A, b: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Int) {
var d = /*p:foo.bar(A)*/a
/*p:foo.bar(A)*/d/*c:foo.bar.A(inc)*/++
/*c:foo.bar.A(inc) p:foo.bar(A)*/++/*p:foo.bar(A)*/d
/*p:foo.bar(A)*/d/*c:foo.bar.A(dec) p:foo.bar(dec)*/--
/*c:foo.bar.A(dec) p:foo.bar(dec) p:foo.bar(A)*/--/*p:foo.bar(A)*/d
/*c:foo.bar.A(dec) p:foo.bar(A) p:foo.bar(dec)*/--/*p:foo.bar(A)*/d
/*p:foo.bar(A)*/a /*c:foo.bar.A(plus)*/+ /*p:kotlin(Int)*/b
/*p:foo.bar(A)*/a /*c:foo.bar.A(minus) p:foo.bar(minus)*/- /*p:kotlin(Int)*/b
@@ -17,8 +17,8 @@ package foo.bar
/*p:foo.bar(A)*/a /*c:foo.bar.A(divAssign) p:foo.bar(divAssign)*//= /*p:kotlin(Int)*/b
// for var
/*p:foo.bar(A)*/d /*c:foo.bar.A(plusAssign) p:foo.bar(plusAssign) p:kotlin(plusAssign) p:kotlin.annotation(plusAssign) p:kotlin.collections(plusAssign) p:kotlin.ranges(plusAssign) p:kotlin.sequences(plusAssign) p:kotlin.text(plusAssign) p:kotlin.io(plusAssign) p:kotlin.comparisons(plusAssign) p:kotlin.js(plusAssign) c:foo.bar.A(plus)*/+= /*p:kotlin(Int)*/b
/*p:foo.bar(A)*/d /*c:foo.bar.A(minusAssign) p:foo.bar(minusAssign) p:kotlin(minusAssign) p:kotlin.annotation(minusAssign) p:kotlin.collections(minusAssign) p:kotlin.ranges(minusAssign) p:kotlin.sequences(minusAssign) p:kotlin.text(minusAssign) p:kotlin.io(minusAssign) p:kotlin.comparisons(minusAssign) p:kotlin.js(minusAssign) c:foo.bar.A(minus) p:foo.bar(minus)*/-= /*p:kotlin(Int)*/b
/*p:foo.bar(A)*/d /*c:foo.bar.A(timesAssign) c:foo.bar.A(times) p:foo.bar(times) p:kotlin(times) p:kotlin.annotation(times) p:kotlin.collections(times) p:kotlin.ranges(times) p:kotlin.sequences(times) p:kotlin.text(times) p:kotlin.io(times) p:kotlin.comparisons(times) p:kotlin.js(times)*/*= /*p:kotlin(Int)*/b
/*p:foo.bar(A)*/d /*c:foo.bar.A(divAssign) p:foo.bar(divAssign) c:foo.bar.A(div) p:foo.bar(div) p:kotlin(div) p:kotlin.annotation(div) p:kotlin.collections(div) p:kotlin.ranges(div) p:kotlin.sequences(div) p:kotlin.text(div) p:kotlin.io(div) p:kotlin.comparisons(div) p:kotlin.js(div)*//= /*p:kotlin(Int)*/b
/*p:foo.bar(A)*/d /*c:foo.bar.A(plus) c:foo.bar.A(plusAssign) p:foo.bar(plusAssign) p:kotlin(plusAssign) p:kotlin.annotation(plusAssign) p:kotlin.collections(plusAssign) p:kotlin.comparisons(plusAssign) p:kotlin.io(plusAssign) p:kotlin.js(plusAssign) p:kotlin.ranges(plusAssign) p:kotlin.sequences(plusAssign) p:kotlin.text(plusAssign)*/+= /*p:kotlin(Int)*/b
/*p:foo.bar(A)*/d /*c:foo.bar.A(minus) c:foo.bar.A(minusAssign) p:foo.bar(minus) p:foo.bar(minusAssign) p:kotlin(minusAssign) p:kotlin.annotation(minusAssign) p:kotlin.collections(minusAssign) p:kotlin.comparisons(minusAssign) p:kotlin.io(minusAssign) p:kotlin.js(minusAssign) p:kotlin.ranges(minusAssign) p:kotlin.sequences(minusAssign) p:kotlin.text(minusAssign)*/-= /*p:kotlin(Int)*/b
/*p:foo.bar(A)*/d /*c:foo.bar.A(times) c:foo.bar.A(timesAssign) p:foo.bar(times) p:kotlin(times) p:kotlin.annotation(times) p:kotlin.collections(times) p:kotlin.comparisons(times) p:kotlin.io(times) p:kotlin.js(times) p:kotlin.ranges(times) p:kotlin.sequences(times) p:kotlin.text(times)*/*= /*p:kotlin(Int)*/b
/*p:foo.bar(A)*/d /*c:foo.bar.A(div) c:foo.bar.A(divAssign) p:foo.bar(div) p:foo.bar(divAssign) p:kotlin(div) p:kotlin.annotation(div) p:kotlin.collections(div) p:kotlin.comparisons(div) p:kotlin.io(div) p:kotlin.js(div) p:kotlin.ranges(div) p:kotlin.sequences(div) p:kotlin.text(div)*//= /*p:kotlin(Int)*/b
}

View File

@@ -1,16 +1,16 @@
package foo.bar
/*p:foo.bar*/fun testOther(a: /*p:foo.bar*/A, b: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Int, c: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Any, na: /*p:foo.bar*/A?) {
/*p:foo.bar(A) c:foo.bar.A(set) p:foo.bar(set)*/a[1] = /*p:foo.bar(A) c:foo.bar.A(get) p:kotlin(Int)*/a[2]
/*p:foo.bar*/fun testOther(a: /*p:foo.bar*/A, b: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Int, c: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Any, na: /*p:foo.bar*/A?) {
/*c:foo.bar.A(set) p:foo.bar(A) p:foo.bar(set)*/a[1] = /*c:foo.bar.A(get) p:foo.bar(A) p:kotlin(Int)*/a[2]
/*p:kotlin(Int) p:kotlin(Boolean)*/b /*c:foo.bar.A(contains)*/in /*p:foo.bar(A)*/a
/*p:kotlin(String) p:kotlin(Boolean)*/"s" /*c:foo.bar.A(contains) p:foo.bar(contains)*/!in /*p:foo.bar(A)*/a
/*p:kotlin(Boolean) p:kotlin(Int)*/b /*c:foo.bar.A(contains)*/in /*p:foo.bar(A)*/a
/*p:kotlin(Boolean) p:kotlin(String)*/"s" /*c:foo.bar.A(contains) p:foo.bar(contains)*/!in /*p:foo.bar(A)*/a
/*c:foo.bar.A(invoke)*/a()
/*c:foo.bar.A(invoke) p:foo.bar p:foo.bar(invoke)*/a(1)
val (/*c:foo.bar.A(component1)*/h, /*c:foo.bar.A(component2) p:foo.bar(component2)*/t) = /*p:foo.bar(A)*/a;
for ((/*c:foo.bar.A(component1)*/f, /*c:foo.bar.A(component2) p:foo.bar(component2)*/s) in /*p:foo.bar(A) c:foo.bar.A(iterator) c:foo.bar.A(hasNext) p:foo.bar(hasNext) c:foo.bar.A(next)*/a);
for ((/*c:foo.bar.A(component1)*/f, /*c:foo.bar.A(component2) p:foo.bar(component2)*/s) in /*p:foo.bar(A) c:foo.bar.A(iterator) p:foo.bar(iterator) c:foo.bar.A(hasNext) p:foo.bar(hasNext) c:foo.bar.A(next)*/na);
for ((/*c:foo.bar.A(component1)*/f, /*c:foo.bar.A(component2) p:foo.bar(component2)*/s) in /*c:foo.bar.A(hasNext) c:foo.bar.A(iterator) c:foo.bar.A(next) p:foo.bar(A) p:foo.bar(hasNext)*/a);
for ((/*c:foo.bar.A(component1)*/f, /*c:foo.bar.A(component2) p:foo.bar(component2)*/s) in /*c:foo.bar.A(hasNext) c:foo.bar.A(iterator) c:foo.bar.A(next) p:foo.bar(A) p:foo.bar(hasNext) p:foo.bar(iterator)*/na);
}

View File

@@ -2,7 +2,7 @@ package foo
// From KT-10772 Problem with daemon on Idea 15.0.3 & 1-dev-25
/*p:foo*/fun <T> identity(): (T) -> T = /*p:kotlin(Nothing) p:kotlin(Function1)*/null as (T) -> T
/*p:foo*/fun <T> identity(): (T) -> T = /*p:kotlin(Function1) p:kotlin(Nothing)*/null as (T) -> T
/*p:foo*/fun <T> compute(f: () -> T) {
val result = f()
@@ -12,4 +12,4 @@ package foo
init {
val a = /*c:foo.Bar c:foo.Bar(T)*/t
}
}
}

View File

@@ -6,14 +6,14 @@ package foo
/*p:foo*/fun getA() = /*p:foo*/A()
/*p:foo*/fun getB() = /*p:foo*/B()
/*p:foo*/fun getListOfA() = /*p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js p:foo p:kotlin.collections(List) p:foo(A)*/listOf(/*p:foo*/A())
/*p:foo*/fun getListOfB() = /*p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js p:foo p:kotlin.collections(List) p:foo(B)*/listOf(/*p:foo*/B())
/*p:foo*/fun getListOfA() = /*p:foo p:foo(A) p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.collections(List) p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/listOf(/*p:foo*/A())
/*p:foo*/fun getListOfB() = /*p:foo p:foo(B) p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.collections(List) p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/listOf(/*p:foo*/B())
/*p:foo*/fun useListOfA(a: /*p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/List</*p:foo*/A>) {}
/*p:foo*/fun useListOfB(b: /*p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/List</*p:foo*/B>) {}
/*p:foo*/fun useListOfA(a: /*p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/List</*p:foo*/A>) {}
/*p:foo*/fun useListOfB(b: /*p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/List</*p:foo*/B>) {}
/*p:foo*/fun testInferredType() {
/*p:foo*/useListOfA(/*p:foo p:kotlin.collections(List) p:foo(A)*/getListOfA())
/*p:foo*/useListOfA(/*p:foo p:kotlin.collections(List) p:foo(B)*/getListOfB())
/*p:foo*/useListOfB(/*p:foo p:kotlin.collections(List) p:foo(B)*/getListOfB())
/*p:foo*/useListOfA(/*p:foo p:foo(A) p:kotlin.collections(List)*/getListOfA())
/*p:foo*/useListOfA(/*p:foo p:foo(B) p:kotlin.collections(List)*/getListOfB())
/*p:foo*/useListOfB(/*p:foo p:foo(B) p:kotlin.collections(List)*/getListOfB())
}

View File

@@ -2,10 +2,10 @@ package foo
/*p:foo*/class C
/*p:foo*/fun lambdaConsumer(fn: (/*p:foo*/A)->/*p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Unit) {}
/*p:foo*/fun extensionConsumer(fn: /*p:foo*/A.()->/*p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Unit) {}
/*p:foo*/fun lambdaConsumer(fn: (/*p:foo*/A)->/*p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Unit) {}
/*p:foo*/fun extensionConsumer(fn: /*p:foo*/A.()->/*p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Unit) {}
/*p:foo*/fun testLambdaParameterType() {
/*p:foo*/lambdaConsumer /*p:kotlin(Function1) p:foo(A)*/{ /*p:foo(A)*/it }
/*p:foo*/extensionConsumer /*p:kotlin(Function1) p:foo(A)*/{ /*p:foo(A)*/this }
}
/*p:foo*/lambdaConsumer /*p:foo(A) p:kotlin(Function1)*/{ /*p:foo(A)*/it }
/*p:foo*/extensionConsumer /*p:foo(A) p:kotlin(Function1)*/{ /*p:foo(A)*/this }
}

View File

@@ -2,16 +2,16 @@ package local.declarations
import bar.*
/*p:local.declarations*/fun f(p: /*p:local.declarations p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Any) /*p:kotlin(Int)*/{
/*p:local.declarations*/fun f(p: /*p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:local.declarations*/Any) /*p:kotlin(Int)*/{
/*p:kotlin(Any) p:kotlin(String)*/p.toString()
val a = /*p:kotlin(Int)*/1
val b = /*p:kotlin(Int)*/a
fun localFun() = /*p:kotlin(Int)*/b
fun /*p:local.declarations p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Int.localExtFun() = /*p:kotlin(Int)*/localFun()
fun /*p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:local.declarations*/Int.localExtFun() = /*p:kotlin(Int)*/localFun()
abstract class LocalI {
abstract var a: /*p:local.declarations p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Int
abstract var a: /*p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:local.declarations*/Int
abstract fun foo()
}

View File

@@ -4,14 +4,14 @@ import bar.*
/*p:baz(C)*/import baz.C
/*p:foo*/val a = /*p:bar p:foo*/A()
/*p:foo*/var b: /*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/baz./*p:baz*/B = /*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js p:baz(B)*/baz./*p:baz*/B()
/*p:foo*/var b: /*p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/baz./*p:baz*/B = /*p:bar p:baz(B) p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/baz./*p:baz*/B()
/*p:foo*/fun function(p: /*p:foo p:bar*/B): /*p:foo p:bar*/B /*p:kotlin(Nothing)*/{
/*p:foo p:bar(A)*/a
/*p:foo*/fun function(p: /*p:bar p:foo*/B): /*p:bar p:foo*/B /*p:kotlin(Nothing)*/{
/*p:bar(A) p:foo*/a
/*p:kotlin(Nothing)*/return /*p:bar p:foo*/B()
}
/*p:foo*/fun /*p:foo*/MyClass.extFunc(p: /**p:foo p:bar*//*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Array</*p:foo p:bar*/B>, e: /*p:foo*/MyEnum, c: /**???*//*p:baz*/C): /*p:foo*/MyInterface /*p:kotlin(Nothing)*/{
/*c:foo.MyClass p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js p:baz(B)*/b
/*p:kotlin(Nothing)*/return /*c:foo.MyClass p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/MyClass()
/*p:foo*/fun /*p:foo*/MyClass.extFunc(p: /**p:foo p:bar*//*p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Array</*p:bar p:foo*/B>, e: /*p:foo*/MyEnum, c: /**???*//*p:baz*/C): /*p:foo*/MyInterface /*p:kotlin(Nothing)*/{
/*c:foo.MyClass p:bar p:baz(B) p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/b
/*p:kotlin(Nothing)*/return /*c:foo.MyClass p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/MyClass()
}

View File

@@ -1,6 +1,6 @@
package foo.bar
/*p:foo.bar*/fun main(args: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Array</*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/String>) {
val f: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Array</*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Int>
val s: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/String
/*p:foo.bar*/fun main(args: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Array</*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/String>) {
val f: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Array</*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Int>
val s: /*p:foo.bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/String
}

View File

@@ -2,6 +2,6 @@ package foo
import bar.*
/*p:foo*/fun <T : /*p:foo*/A?, B : /*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Iterable</*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Number>, C, D> test()
where C : /*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Number, C : /*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Comparable</*p:foo p:bar p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:kotlin.js*/Number>, D : B
/*p:foo*/fun <T : /*p:foo*/A?, B : /*p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Iterable</*p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Number>, C, D> test()
where C : /*p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Number, C : /*p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Comparable</*p:bar p:foo p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.comparisons p:kotlin.io p:kotlin.js p:kotlin.ranges p:kotlin.sequences p:kotlin.text*/Number>, D : B
{}

Some files were not shown because too many files have changed in this diff Show More