From b616ef0a40c128d818610fe1d87fd5227a924111 Mon Sep 17 00:00:00 2001 From: Stanislav Erokhin Date: Mon, 6 Feb 2017 20:31:42 +0300 Subject: [PATCH] Do not force resolve descriptors for explicit imports. Create lazy scope instead. --- .../kotlin/resolve/LazyExplicitImportScope.kt | 117 ++++++++++++++++++ .../resolve/QualifiedExpressionResolver.kt | 106 +++++----------- .../kotlin/resolve/SingleImportScope.kt | 45 ------- .../kotlin/resolve/lazy/LazyImportScope.kt | 21 ++-- .../diagnostics/tests/regressions/kt16086.kt | 20 +++ .../diagnostics/tests/regressions/kt16086.txt | 47 +++++++ .../tests/regressions/kt16086_2.kt | 13 ++ .../tests/regressions/kt16086_2.txt | 21 ++++ .../checkers/DiagnosticsTestGenerated.java | 12 ++ .../imports/NoImportForBuiltIns.expected.kt | 2 +- .../classifierMembers/constraints.kt | 4 +- .../lookupTracker/classifierMembers/foo.kt | 8 +- .../lookupTracker/conventions/comparison.kt | 2 +- .../lookupTracker/conventions/declarations.kt | 24 ++-- .../conventions/delegateProperty.kt | 14 +-- .../conventions/mathematicalLike.kt | 2 +- .../lookupTracker/conventions/other.kt | 2 +- .../expressionType/inferredType.kt | 4 +- .../expressionType/lambdaParameterType.kt | 4 +- .../incremental/lookupTracker/java/usages.kt | 22 ++-- .../lookupTracker/localDeclarations/locals.kt | 6 +- .../lookupTracker/packageDeclarations/foo1.kt | 4 +- .../incremental/lookupTracker/simple/main.kt | 6 +- .../syntheticProperties/KotlinClass.kt | 6 +- .../syntheticProperties/usages.kt | 4 +- 25 files changed, 333 insertions(+), 183 deletions(-) create mode 100644 compiler/frontend/src/org/jetbrains/kotlin/resolve/LazyExplicitImportScope.kt delete mode 100644 compiler/frontend/src/org/jetbrains/kotlin/resolve/SingleImportScope.kt create mode 100644 compiler/testData/diagnostics/tests/regressions/kt16086.kt create mode 100644 compiler/testData/diagnostics/tests/regressions/kt16086.txt create mode 100644 compiler/testData/diagnostics/tests/regressions/kt16086_2.kt create mode 100644 compiler/testData/diagnostics/tests/regressions/kt16086_2.txt diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/LazyExplicitImportScope.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/LazyExplicitImportScope.kt new file mode 100644 index 00000000000..43f66aee1e8 --- /dev/null +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/LazyExplicitImportScope.kt @@ -0,0 +1,117 @@ +/* + * Copyright 2010-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.resolve + +import com.intellij.util.SmartList +import org.jetbrains.kotlin.descriptors.* +import org.jetbrains.kotlin.incremental.components.LookupLocation +import org.jetbrains.kotlin.incremental.components.NoLookupLocation +import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.resolve.scopes.BaseImportingScope +import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter +import org.jetbrains.kotlin.resolve.scopes.MemberScope +import org.jetbrains.kotlin.utils.Printer +import org.jetbrains.kotlin.utils.addIfNotNull +import org.jetbrains.kotlin.utils.addToStdlib.check + +class LazyExplicitImportScope( + private val packageOrClassDescriptor: DeclarationDescriptor, + private val packageFragmentForVisibilityCheck: PackageFragmentDescriptor?, + private val declaredName: Name, + private val aliasName: Name, + private val storeReferences: (Collection) -> Unit +): BaseImportingScope(null) { + + override fun getContributedClassifier(name: Name, location: LookupLocation): ClassifierDescriptor? { + if (name != aliasName) return null + + return when (packageOrClassDescriptor) { + is PackageViewDescriptor -> packageOrClassDescriptor.memberScope.getContributedClassifier(declaredName, location) + is ClassDescriptor -> packageOrClassDescriptor.unsubstitutedInnerClassesScope.getContributedClassifier(declaredName, location) + else -> throw IllegalStateException("Should be class or package: $packageOrClassDescriptor") + } + } + + override fun getContributedFunctions(name: Name, location: LookupLocation): Collection { + if (name != aliasName) return emptyList() + + return collectCallableMemberDescriptors(location, MemberScope::getContributedFunctions) + } + + override fun getContributedVariables(name: Name, location: LookupLocation): Collection { + if (name != aliasName) return emptyList() + + return collectCallableMemberDescriptors(location, MemberScope::getContributedVariables) + } + + override fun getContributedDescriptors(kindFilter: DescriptorKindFilter, nameFilter: (Name) -> Boolean): Collection { + val descriptors = SmartList() + descriptors.addIfNotNull(getContributedClassifier(aliasName, NoLookupLocation.WHEN_GET_ALL_DESCRIPTORS)) + descriptors.addAll(getContributedFunctions(aliasName, NoLookupLocation.WHEN_GET_ALL_DESCRIPTORS)) + descriptors.addAll(getContributedVariables(aliasName, NoLookupLocation.WHEN_GET_ALL_DESCRIPTORS)) + + return descriptors + } + + override fun printStructure(p: Printer) { + p.println(javaClass.simpleName, ": ", aliasName) + } + + // should be called only once + internal fun storeReferencesToDescriptors() = getContributedDescriptors().apply(storeReferences) + + private fun collectCallableMemberDescriptors( + location: LookupLocation, + getDescriptors: MemberScope.(Name, LookupLocation) -> Collection + ): Collection { + val descriptors = SmartList() + + when (packageOrClassDescriptor) { + is PackageViewDescriptor -> { + val packageScope = packageOrClassDescriptor.memberScope + descriptors.addAll(packageScope.getDescriptors(declaredName, location)) + } + + is ClassDescriptor -> { + val staticClassScope = packageOrClassDescriptor.staticScope + descriptors.addAll(staticClassScope.getDescriptors(declaredName, location)) + + if (packageOrClassDescriptor.kind == ClassKind.OBJECT) { + descriptors.addAll( + packageOrClassDescriptor.unsubstitutedMemberScope.getDescriptors(declaredName, location) + .mapNotNull { it.asImportedFromObjectIfPossible() } + ) + } + } + + else -> throw IllegalStateException("Should be class or package: $packageOrClassDescriptor") + } + + return descriptors.choseOnlyVisibleOrAll() + } + + @Suppress("UNCHECKED_CAST") + private fun D.asImportedFromObjectIfPossible(): D? = when (this) { + is PropertyDescriptor -> asImportedFromObject() as D + is FunctionDescriptor -> asImportedFromObject() as D + else -> null + } + + private fun Collection.choseOnlyVisibleOrAll() = + filter { isVisible(it, packageFragmentForVisibilityCheck, position = QualifierPosition.IMPORT) }. + check { it.isNotEmpty() } ?: this +} \ No newline at end of file diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/QualifiedExpressionResolver.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/QualifiedExpressionResolver.kt index fb482a09f80..c6e8bf8c3c4 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/QualifiedExpressionResolver.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/QualifiedExpressionResolver.kt @@ -36,7 +36,6 @@ import org.jetbrains.kotlin.resolve.scopes.utils.memberScopeAsImportingScope import org.jetbrains.kotlin.resolve.source.KotlinSourceElement import org.jetbrains.kotlin.types.expressions.ExpressionTypingContext import org.jetbrains.kotlin.types.expressions.isWithoutValueArguments -import org.jetbrains.kotlin.utils.addIfNotNull import org.jetbrains.kotlin.utils.addToStdlib.check class QualifiedExpressionResolver { @@ -107,7 +106,7 @@ class QualifiedExpressionResolver { val lastPart = qualifierPartList.last() val classifier = when (qualifier) { is PackageViewDescriptor -> qualifier.memberScope.getContributedClassifier(lastPart.name, lastPart.location) - is ClassDescriptor -> { + is ClassDescriptor -> { val descriptor = qualifier.unsubstitutedInnerClassesScope.getContributedClassifier(lastPart.name, lastPart.location) checkNotEnumEntry(descriptor, trace, lastPart.expression) descriptor @@ -207,7 +206,7 @@ class QualifiedExpressionResolver { path: List, lastPart: QualifierPart, packageFragmentForVisibilityCheck: PackageFragmentDescriptor? - ): SingleImportScope? { + ): ImportingScope? { val aliasName = KtPsiUtil.getAliasName(importDirective) if (aliasName == null) { // import kotlin. @@ -220,58 +219,16 @@ class QualifiedExpressionResolver { packageFragmentForVisibilityCheck, scopeForFirstPart = null, position = QualifierPosition.IMPORT ) ?: return null - val candidates = collectCandidateDescriptors(lastPart, packageOrClassDescriptor) - if (candidates.isNotEmpty()) { - storeResult(trace, lastPart.expression, candidates, packageFragmentForVisibilityCheck, position = QualifierPosition.IMPORT, isQualifier = false) - } - else { - tryResolveDescriptorsWhichCannotBeImported(trace, moduleDescriptor, packageOrClassDescriptor, lastPart) - return null - } + return LazyExplicitImportScope(packageOrClassDescriptor, packageFragmentForVisibilityCheck, lastPart.name, aliasName) { + candidates -> - val importedDescriptors = candidates.filter { isVisible(it, packageFragmentForVisibilityCheck, position = QualifierPosition.IMPORT) }. - check { it.isNotEmpty() } ?: candidates - - return SingleImportScope(aliasName, importedDescriptors) - } - - private fun collectCandidateDescriptors(lastPart: QualifierPart, packageOrClassDescriptor: DeclarationDescriptor): SmartList { - val descriptors = SmartList() - - val lastName = lastPart.name - val location = lastPart.location - when (packageOrClassDescriptor) { - is PackageViewDescriptor -> { - val packageScope = packageOrClassDescriptor.memberScope - descriptors.addIfNotNull(packageScope.getContributedClassifier(lastName, location)) - descriptors.addAll(packageScope.getContributedVariables(lastName, location)) - descriptors.addAll(packageScope.getContributedFunctions(lastName, location)) + if (candidates.isNotEmpty()) { + storeResult(trace, lastPart.expression, candidates, packageFragmentForVisibilityCheck, position = QualifierPosition.IMPORT, isQualifier = false) } - - is ClassDescriptor -> { - descriptors.addIfNotNull( - packageOrClassDescriptor.unsubstitutedInnerClassesScope.getContributedClassifier(lastName, location) - ) - val staticClassScope = packageOrClassDescriptor.staticScope - descriptors.addAll(staticClassScope.getContributedFunctions(lastName, location)) - descriptors.addAll(staticClassScope.getContributedVariables(lastName, location)) - - if (packageOrClassDescriptor.kind == ClassKind.OBJECT) { - descriptors.addAll( - packageOrClassDescriptor.unsubstitutedMemberScope.getContributedFunctions(lastName, location) - .map { it.asImportedFromObject() } - ) - descriptors.addAll( - packageOrClassDescriptor.unsubstitutedMemberScope.getContributedVariables(lastName, location) - .filterIsInstance() - .map { it.asImportedFromObject() } - ) - } + else { + tryResolveDescriptorsWhichCannotBeImported(trace, moduleDescriptor, packageOrClassDescriptor, lastPart) } - - else -> throw IllegalStateException("Should be class or package: $packageOrClassDescriptor") } - return descriptors } private fun tryResolveDescriptorsWhichCannotBeImported( @@ -344,9 +301,6 @@ class QualifiedExpressionResolver { val location = KotlinLookupLocation(expression) } - private enum class QualifierPosition { - PACKAGE_HEADER, IMPORT, TYPE, EXPRESSION - } private fun resolveToPackageOrClass( path: List, @@ -403,7 +357,7 @@ class QualifiedExpressionResolver { moduleDescriptor.quickResolveToPackage(path, trace, position) var currentDescriptor: DeclarationDescriptor? = prefixDescriptor - for (qualifierPartIndex in nextIndexAfterPrefix .. path.size - 1) { + for (qualifierPartIndex in nextIndexAfterPrefix..path.size - 1) { val qualifierPart = path[qualifierPartIndex] val nextPackageOrClassDescriptor = @@ -499,7 +453,7 @@ class QualifiedExpressionResolver { ) if (result == null) return QualifiedExpressionResolveResult.UNRESOLVED - return when(index) { + return when (index) { path.size -> QualifiedExpressionResolveResult(result, null) path.size - 1 -> QualifiedExpressionResolveResult(result, path[index].name) else -> QualifiedExpressionResolveResult.UNRESOLVED @@ -640,12 +594,12 @@ class QualifiedExpressionResolver { if (descriptor is DeclarationDescriptorWithVisibility) { val fromToCheck = - if (shouldBeVisibleFrom is PackageFragmentDescriptor && shouldBeVisibleFrom.source == SourceElement.NO_SOURCE && referenceExpression.containingFile !is DummyHolder) { - PackageFragmentWithCustomSource(shouldBeVisibleFrom, KotlinSourceElement(referenceExpression.getContainingKtFile())) - } - else { - shouldBeVisibleFrom - } + if (shouldBeVisibleFrom is PackageFragmentDescriptor && shouldBeVisibleFrom.source == SourceElement.NO_SOURCE && referenceExpression.containingFile !is DummyHolder) { + PackageFragmentWithCustomSource(shouldBeVisibleFrom, KotlinSourceElement(referenceExpression.getContainingKtFile())) + } + else { + shouldBeVisibleFrom + } if (!isVisible(descriptor, fromToCheck, position)) { trace.report(Errors.INVISIBLE_REFERENCE.on(referenceExpression, descriptor, descriptor.visibility, descriptor)) } @@ -671,21 +625,25 @@ class QualifiedExpressionResolver { return qualifier } +} - private fun isVisible( - descriptor: DeclarationDescriptor, - shouldBeVisibleFrom: DeclarationDescriptor?, - position: QualifierPosition - ): Boolean { - if (descriptor !is DeclarationDescriptorWithVisibility || shouldBeVisibleFrom == null) return true +internal fun isVisible( + descriptor: DeclarationDescriptor, + shouldBeVisibleFrom: DeclarationDescriptor?, + position: QualifierPosition +): Boolean { + if (descriptor !is DeclarationDescriptorWithVisibility || shouldBeVisibleFrom == null) return true - val visibility = descriptor.visibility - if (position == QualifierPosition.IMPORT) { - if (Visibilities.isPrivate(visibility)) return false - if (!visibility.mustCheckInImports()) return true - } - return Visibilities.isVisibleIgnoringReceiver(descriptor, shouldBeVisibleFrom) + val visibility = descriptor.visibility + if (position == QualifierPosition.IMPORT) { + if (Visibilities.isPrivate(visibility)) return false + if (!visibility.mustCheckInImports()) return true } + return Visibilities.isVisibleIgnoringReceiver(descriptor, shouldBeVisibleFrom) +} + +internal enum class QualifierPosition { + PACKAGE_HEADER, IMPORT, TYPE, EXPRESSION } /* diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/SingleImportScope.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/SingleImportScope.kt deleted file mode 100644 index b0472ec3392..00000000000 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/SingleImportScope.kt +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.resolve - -import org.jetbrains.kotlin.descriptors.* -import org.jetbrains.kotlin.incremental.components.LookupLocation -import org.jetbrains.kotlin.name.Name -import org.jetbrains.kotlin.resolve.scopes.BaseImportingScope -import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter -import org.jetbrains.kotlin.utils.Printer - -class SingleImportScope(private val aliasName: Name, private val descriptors: Collection) : BaseImportingScope(null) { - override fun getContributedClassifier(name: Name, location: LookupLocation) - = if (name == aliasName) descriptors.filterIsInstance().singleOrNull() else null - - override fun getContributedPackage(name: Name) - = if (name == aliasName) descriptors.filterIsInstance().singleOrNull() else null - - override fun getContributedVariables(name: Name, location: LookupLocation) - = if (name == aliasName) descriptors.filterIsInstance() else emptyList() - - override fun getContributedFunctions(name: Name, location: LookupLocation) - = if (name == aliasName) descriptors.filterIsInstance() else emptyList() - - override fun getContributedDescriptors(kindFilter: DescriptorKindFilter, nameFilter: (Name) -> Boolean) - = descriptors - - override fun printStructure(p: Printer) { - p.println(javaClass.simpleName, ": ", aliasName) - } -} diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/LazyImportScope.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/LazyImportScope.kt index 5a393e587c3..cd3ef187f99 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/LazyImportScope.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/LazyImportScope.kt @@ -88,13 +88,20 @@ class LazyImportResolver( qualifiedExpressionResolver.processImportReference( directive, moduleDescriptor, traceForImportResolve, excludedImportNames, packageFragment - )?.apply { - if (!directive.isAllUnder) { - PlatformClassesMappedToKotlinChecker.checkPlatformClassesMappedToKotlin( - platformToKotlinClassMap, traceForImportResolve, directive, getContributedDescriptors() - ) - } + ) + } + + private val forceResolveImportDirective = storageManager.createMemoizedFunction { + directive: KtImportDirective -> + val scope = importedScopesProvider(directive) + if (scope is LazyExplicitImportScope) { + val allDescriptors = scope.storeReferencesToDescriptors() + PlatformClassesMappedToKotlinChecker.checkPlatformClassesMappedToKotlin( + platformToKotlinClassMap, traceForImportResolve, directive, allDescriptors + ) } + + Unit } override fun forceResolveAllImports() { @@ -140,7 +147,7 @@ class LazyImportResolver( } override fun forceResolveImport(importDirective: KtImportDirective) { - getImportScope(importDirective) + forceResolveImportDirective(importDirective) } fun selectSingleFromImports( diff --git a/compiler/testData/diagnostics/tests/regressions/kt16086.kt b/compiler/testData/diagnostics/tests/regressions/kt16086.kt new file mode 100644 index 00000000000..c1bcfe19a18 --- /dev/null +++ b/compiler/testData/diagnostics/tests/regressions/kt16086.kt @@ -0,0 +1,20 @@ +// FILE: com/winterbe/domain/IEntity.java +package com.winterbe.domain; +import com.winterbe.observer.ObserverSupport; + +public interface IEntity { + ObserverSupport getObserverSupport(); +} + +// FILE: 1.kt +package com.winterbe.observer +import com.winterbe.domain.IEntity + +abstract class Observer : List + + +// FILE: 2.kt +package com.winterbe.observer +import com.winterbe.domain.IEntity + +class ObserverSupport(private val observers: List) diff --git a/compiler/testData/diagnostics/tests/regressions/kt16086.txt b/compiler/testData/diagnostics/tests/regressions/kt16086.txt new file mode 100644 index 00000000000..ced19ac5b32 --- /dev/null +++ b/compiler/testData/diagnostics/tests/regressions/kt16086.txt @@ -0,0 +1,47 @@ +package + +package com { + + package com.winterbe { + + package com.winterbe.domain { + public /*synthesized*/ fun IEntity(/*0*/ function: () -> com.winterbe.observer.ObserverSupport<(raw) com.winterbe.domain.IEntity>!): com.winterbe.domain.IEntity + + public interface IEntity { + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public abstract fun getObserverSupport(): com.winterbe.observer.ObserverSupport<(raw) com.winterbe.domain.IEntity>! + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + } + + package com.winterbe.observer { + + public abstract class Observer : kotlin.collections.List { + public constructor Observer() + public abstract override /*1*/ /*fake_override*/ val size: kotlin.Int + public abstract override /*1*/ /*fake_override*/ fun contains(/*0*/ element: com.winterbe.domain.IEntity): kotlin.Boolean + public abstract override /*1*/ /*fake_override*/ fun containsAll(/*0*/ elements: kotlin.collections.Collection): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public abstract override /*1*/ /*fake_override*/ fun get(/*0*/ index: kotlin.Int): com.winterbe.domain.IEntity + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public abstract override /*1*/ /*fake_override*/ fun indexOf(/*0*/ element: com.winterbe.domain.IEntity): kotlin.Int + public abstract override /*1*/ /*fake_override*/ fun isEmpty(): kotlin.Boolean + public abstract override /*1*/ /*fake_override*/ fun iterator(): kotlin.collections.Iterator + public abstract override /*1*/ /*fake_override*/ fun lastIndexOf(/*0*/ element: com.winterbe.domain.IEntity): kotlin.Int + public abstract override /*1*/ /*fake_override*/ fun listIterator(): kotlin.collections.ListIterator + public abstract override /*1*/ /*fake_override*/ fun listIterator(/*0*/ index: kotlin.Int): kotlin.collections.ListIterator + public abstract override /*1*/ /*fake_override*/ fun subList(/*0*/ fromIndex: kotlin.Int, /*1*/ toIndex: kotlin.Int): kotlin.collections.List + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + public final class ObserverSupport { + public constructor ObserverSupport(/*0*/ observers: kotlin.collections.List) + private final val observers: kotlin.collections.List + 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 + } + } + } +} diff --git a/compiler/testData/diagnostics/tests/regressions/kt16086_2.kt b/compiler/testData/diagnostics/tests/regressions/kt16086_2.kt new file mode 100644 index 00000000000..603a4237f8d --- /dev/null +++ b/compiler/testData/diagnostics/tests/regressions/kt16086_2.kt @@ -0,0 +1,13 @@ +// FILE: 1.kt +package a +import b.ObserverSupport + +interface IEntity + +fun IEntity(f: ObserverSupport) {} + +// FILE: 2.kt +package b +import a.IEntity + +class ObserverSupport \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/kt16086_2.txt b/compiler/testData/diagnostics/tests/regressions/kt16086_2.txt new file mode 100644 index 00000000000..2fe5fded2bf --- /dev/null +++ b/compiler/testData/diagnostics/tests/regressions/kt16086_2.txt @@ -0,0 +1,21 @@ +package + +package a { + public fun IEntity(/*0*/ f: b.ObserverSupport): kotlin.Unit + + public interface IEntity { + 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 + } +} + +package b { + + public final class ObserverSupport { + public constructor ObserverSupport() + 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 + } +} diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java index 6b0353e51b9..ad2edd1d4c1 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java @@ -16129,6 +16129,18 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest { doTest(fileName); } + @TestMetadata("kt16086.kt") + public void testKt16086() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/regressions/kt16086.kt"); + doTest(fileName); + } + + @TestMetadata("kt16086_2.kt") + public void testKt16086_2() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/regressions/kt16086_2.kt"); + doTest(fileName); + } + @TestMetadata("kt1639-JFrame.kt") public void testKt1639_JFrame() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/regressions/kt1639-JFrame.kt"); diff --git a/idea/testData/copyPaste/imports/NoImportForBuiltIns.expected.kt b/idea/testData/copyPaste/imports/NoImportForBuiltIns.expected.kt index c9d71ce3187..2fe0e1b2f4d 100644 --- a/idea/testData/copyPaste/imports/NoImportForBuiltIns.expected.kt +++ b/idea/testData/copyPaste/imports/NoImportForBuiltIns.expected.kt @@ -1,7 +1,7 @@ // ERROR: Cannot access 'd': it is private in file -// ERROR: Cannot access 'd': it is private in file // ERROR: Cannot access 'b': it is private in file // ERROR: Cannot access 'b': it is private in file +// ERROR: Cannot access 'd': it is private in file package to import a.b diff --git a/jps-plugin/testData/incremental/lookupTracker/classifierMembers/constraints.kt b/jps-plugin/testData/incremental/lookupTracker/classifierMembers/constraints.kt index 579534024ae..400f192507b 100644 --- a/jps-plugin/testData/incremental/lookupTracker/classifierMembers/constraints.kt +++ b/jps-plugin/testData/incremental/lookupTracker/classifierMembers/constraints.kt @@ -2,6 +2,6 @@ package foo import bar.* -/*p:foo*/fun , C, D> test() - where C : /*p:foo*/Number, C : /*p:foo*/Comparable, D : B +/*p:foo*/fun , C, D> test() + where C : /*p:foo p:kotlin*/Number, C : /*p:foo p:kotlin*/Comparable, D : B {} diff --git a/jps-plugin/testData/incremental/lookupTracker/classifierMembers/foo.kt b/jps-plugin/testData/incremental/lookupTracker/classifierMembers/foo.kt index 14b086ed71e..b932c75deba 100644 --- a/jps-plugin/testData/incremental/lookupTracker/classifierMembers/foo.kt +++ b/jps-plugin/testData/incremental/lookupTracker/classifierMembers/foo.kt @@ -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*/String + val c: /*c:foo.A c:foo.A.Companion p:foo p:kotlin*/String get() = /*c:foo.A p:kotlin(String)*/b - var d: /*c:foo.A c:foo.A.Companion p:foo*/String = /*p:kotlin(String)*/"ddd" + var d: /*c:foo.A c:foo.A.Companion p:foo p:kotlin*/String = /*p:kotlin(String)*/"ddd" get() = /*p:kotlin(String)*/field set(v) { /*p:kotlin(String)*/field = /*p:kotlin(String)*/v } @@ -27,7 +27,7 @@ import bar.* 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*/Int) {} + fun bar(a: /*c:foo.A.B.CO c:foo.A.B c:foo.A c:foo.A.Companion p:foo p:kotlin*/Int) {} } } @@ -44,7 +44,7 @@ import bar.* } /*p:foo*/interface I { - var a: /*c:foo.I p:foo*/Int + var a: /*c:foo.I p:foo p:kotlin*/Int fun foo() class NI diff --git a/jps-plugin/testData/incremental/lookupTracker/conventions/comparison.kt b/jps-plugin/testData/incremental/lookupTracker/conventions/comparison.kt index 5eb74e65463..98747a87e47 100644 --- a/jps-plugin/testData/incremental/lookupTracker/conventions/comparison.kt +++ b/jps-plugin/testData/incremental/lookupTracker/conventions/comparison.kt @@ -1,6 +1,6 @@ package foo.bar -/*p:foo.bar*/fun testComparisons(a: /*p:foo.bar*/A, b: /*p:foo.bar*/Int, c: /*p:foo.bar*/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*/Int, c: /*p:foo.bar p:kotlin*/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 diff --git a/jps-plugin/testData/incremental/lookupTracker/conventions/declarations.kt b/jps-plugin/testData/incremental/lookupTracker/conventions/declarations.kt index ef0612c5cba..46c5c01f611 100644 --- a/jps-plugin/testData/incremental/lookupTracker/conventions/declarations.kt +++ b/jps-plugin/testData/incremental/lookupTracker/conventions/declarations.kt @@ -1,15 +1,15 @@ package foo.bar /*p:foo.bar*/class A { - operator fun plus(a: /*c:foo.bar.A p:foo.bar*/Int) = /*p:foo.bar(A)*/this - operator fun timesAssign(a: /*c:foo.bar.A p:foo.bar*/Any?) {} + operator fun plus(a: /*c:foo.bar.A p:foo.bar p:kotlin*/Int) = /*p:foo.bar(A)*/this + operator fun timesAssign(a: /*c:foo.bar.A p:foo.bar p:kotlin*/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*/Int) = /*p:kotlin(Int)*/1 - operator fun contains(a: /*c:foo.bar.A p:foo.bar*/Int): /*c:foo.bar.A p:foo.bar*/Boolean = /*p:kotlin(Boolean)*/false + operator fun get(i: /*c:foo.bar.A p:foo.bar p:kotlin*/Int) = /*p:kotlin(Int)*/1 + operator fun contains(a: /*c:foo.bar.A p:foo.bar p:kotlin*/Int): /*c:foo.bar.A p:foo.bar p:kotlin*/Boolean = /*p:kotlin(Boolean)*/false operator fun invoke() {} - operator fun compareTo(a: /*c:foo.bar.A p:foo.bar*/Int) = /*p:kotlin(Int)*/0 + operator fun compareTo(a: /*c:foo.bar.A p:foo.bar p:kotlin*/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*/Int) = /*p:foo.bar(A)*/this -/*p:foo.bar*/operator fun /*p:foo.bar*/A.divAssign(a: /*p:foo.bar*/Any?) {} +/*p:foo.bar*/operator fun /*p:foo.bar*/A.minus(a: /*p:foo.bar p:kotlin*/Int) = /*p:foo.bar(A)*/this +/*p:foo.bar*/operator fun /*p:foo.bar*/A.divAssign(a: /*p:foo.bar p:kotlin*/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*/Int, v: /*p:foo.bar*/Int) {} -/*p:foo.bar*/operator fun /*p:foo.bar*/A.contains(a: /*p:foo.bar*/Any): /*p:foo.bar*/Boolean = /*p:kotlin(Boolean)*/true -/*p:foo.bar*/operator fun /*p:foo.bar*/A.invoke(i: /*p:foo.bar*/Int) {} +/*p:foo.bar*/operator fun /*p:foo.bar*/A.set(i: /*p:foo.bar p:kotlin*/Int, v: /*p:foo.bar p:kotlin*/Int) {} +/*p:foo.bar*/operator fun /*p:foo.bar*/A.contains(a: /*p:foo.bar p:kotlin*/Any): /*p:foo.bar p:kotlin*/Boolean = /*p:kotlin(Boolean)*/true +/*p:foo.bar*/operator fun /*p:foo.bar*/A.invoke(i: /*p:foo.bar p:kotlin*/Int) {} -/*p:foo.bar*/operator fun /*p:foo.bar*/A.compareTo(a: /*p:foo.bar*/Any) = /*p:kotlin(Int)*/0 +/*p:foo.bar*/operator fun /*p:foo.bar*/A.compareTo(a: /*p:foo.bar p:kotlin*/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*/Boolean = /*p:kotlin(Boolean)*/false +/*p:foo.bar*/operator fun /*p:foo.bar*/A.hasNext(): /*p:foo.bar p:kotlin*/Boolean = /*p:kotlin(Boolean)*/false diff --git a/jps-plugin/testData/incremental/lookupTracker/conventions/delegateProperty.kt b/jps-plugin/testData/incremental/lookupTracker/conventions/delegateProperty.kt index 8c564e7e8fe..4402628b9dd 100644 --- a/jps-plugin/testData/incremental/lookupTracker/conventions/delegateProperty.kt +++ b/jps-plugin/testData/incremental/lookupTracker/conventions/delegateProperty.kt @@ -1,22 +1,22 @@ package foo.bar -import kotlin.reflect./*p:kotlin.reflect*/KProperty +/*p:kotlin.reflect(KProperty)*/import kotlin.reflect.KProperty /*p:foo.bar*/class D1 { - operator fun getValue(t: /*c:foo.bar.D1 p:foo.bar*/Any?, p: /*c:foo.bar.D1*/KProperty<*>) = /*p:kotlin(Int)*/1 + operator fun getValue(t: /*c:foo.bar.D1 p:foo.bar p:kotlin*/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*/Any?, p: KProperty<*>, v: /*p:foo.bar*/Int) {} +/*p:foo.bar*/operator fun /*p:foo.bar*/D1.setValue(t: /*p:foo.bar p:kotlin*/Any?, p: /*p:kotlin.reflect*/KProperty<*>, v: /*p:foo.bar p:kotlin*/Int) {} /*p:foo.bar(D2)*/open class D2 { - operator fun setValue(t: /*c:foo.bar.D2 p:foo.bar*/Any?, p: /*c:foo.bar.D2*/KProperty<*>, v: /*c:foo.bar.D2 p:foo.bar*/Int) {} + operator fun setValue(t: /*c:foo.bar.D2 p:foo.bar p:kotlin*/Any?, p: /*c:foo.bar.D2 p:kotlin.reflect*/KProperty<*>, v: /*c:foo.bar.D2 p:foo.bar p:kotlin*/Int) {} } -/*p:foo.bar*/operator fun /*p:foo.bar*/D2.getValue(t: /*p:foo.bar*/Any?, p: KProperty<*>) = /*p:kotlin(Int)*/1 -/*p:foo.bar*/operator fun /*p:foo.bar*/D2.provideDelegate(p: /*p:foo.bar*/Any?, k: /*p:foo.bar*/Any) = /*p:foo.bar(D2)*/this +/*p:foo.bar*/operator fun /*p:foo.bar*/D2.getValue(t: /*p:foo.bar p:kotlin*/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*/Any?, k: /*p:foo.bar p:kotlin*/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*/Any?, k: /*c:foo.bar.D3 c:foo.bar.D2 p:foo.bar*/Any) = /*p:foo.bar(D3)*/this + operator fun provideDelegate(p: /*c:foo.bar.D3 c:foo.bar.D2 p:foo.bar p:kotlin*/Any?, k: /*c:foo.bar.D3 c:foo.bar.D2 p:foo.bar p:kotlin*/Any) = /*p:foo.bar(D3)*/this } diff --git a/jps-plugin/testData/incremental/lookupTracker/conventions/mathematicalLike.kt b/jps-plugin/testData/incremental/lookupTracker/conventions/mathematicalLike.kt index a342737f5ed..1cf542a2a67 100644 --- a/jps-plugin/testData/incremental/lookupTracker/conventions/mathematicalLike.kt +++ b/jps-plugin/testData/incremental/lookupTracker/conventions/mathematicalLike.kt @@ -1,6 +1,6 @@ package foo.bar -/*p:foo.bar*/fun testOperators(a: /*p:foo.bar*/A, b: /*p:foo.bar*/Int) { +/*p:foo.bar*/fun testOperators(a: /*p:foo.bar*/A, b: /*p:foo.bar p:kotlin*/Int) { var d = /*p:foo.bar(A)*/a /*p:foo.bar(A)*/d/*c:foo.bar.A(inc)*/++ diff --git a/jps-plugin/testData/incremental/lookupTracker/conventions/other.kt b/jps-plugin/testData/incremental/lookupTracker/conventions/other.kt index bf27ef791d0..d6c85490321 100644 --- a/jps-plugin/testData/incremental/lookupTracker/conventions/other.kt +++ b/jps-plugin/testData/incremental/lookupTracker/conventions/other.kt @@ -1,6 +1,6 @@ package foo.bar -/*p:foo.bar*/fun testOther(a: /*p:foo.bar*/A, b: /*p:foo.bar*/Int, c: /*p:foo.bar*/Any, na: /*p:foo.bar*/A?) { +/*p:foo.bar*/fun testOther(a: /*p:foo.bar*/A, b: /*p:foo.bar p:kotlin*/Int, c: /*p:foo.bar p:kotlin*/Any, na: /*p:foo.bar*/A?) { /*p:foo.bar(A) c:foo.bar.A(set) c:foo.bar.A(getSet) c:foo.bar.A(getSET) p:foo.bar(set)*/a[1] = /*p:foo.bar(A) c:foo.bar.A(get) p:kotlin(Int)*/a[2] /*p:kotlin(Int) p:kotlin(Boolean)*/b /*c:foo.bar.A(contains)*/in /*p:foo.bar(A)*/a diff --git a/jps-plugin/testData/incremental/lookupTracker/expressionType/inferredType.kt b/jps-plugin/testData/incremental/lookupTracker/expressionType/inferredType.kt index bd562af2dea..a64392dfd7a 100644 --- a/jps-plugin/testData/incremental/lookupTracker/expressionType/inferredType.kt +++ b/jps-plugin/testData/incremental/lookupTracker/expressionType/inferredType.kt @@ -9,8 +9,8 @@ package foo /*p:foo*/fun getListOfA() = /*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:java.lang p:kotlin.jvm p:kotlin.collections(List) p:foo(A)*/listOf(/*p:foo*/A()) /*p:foo*/fun getListOfB() = /*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:java.lang p:kotlin.jvm p:kotlin.collections(List) p:foo(B)*/listOf(/*p:foo*/B()) -/*p:foo*/fun useListOfA(a: /*p:foo*/List) {} -/*p:foo*/fun useListOfB(b: /*p:foo*/List) {} +/*p:foo*/fun useListOfA(a: /*p:foo p:kotlin.collections*/List) {} +/*p:foo*/fun useListOfB(b: /*p:foo p:kotlin.collections*/List) {} /*p:foo*/fun testInferredType() { /*p:foo*/useListOfA(/*p:foo p:kotlin.collections(List) p:foo(A)*/getListOfA()) diff --git a/jps-plugin/testData/incremental/lookupTracker/expressionType/lambdaParameterType.kt b/jps-plugin/testData/incremental/lookupTracker/expressionType/lambdaParameterType.kt index 736fba6ade3..e55acec918c 100644 --- a/jps-plugin/testData/incremental/lookupTracker/expressionType/lambdaParameterType.kt +++ b/jps-plugin/testData/incremental/lookupTracker/expressionType/lambdaParameterType.kt @@ -2,8 +2,8 @@ package foo /*p:foo*/class C -/*p:foo*/fun lambdaConsumer(fn: (/*p:foo*/A)->/*p:foo*/Unit) {} -/*p:foo*/fun extensionConsumer(fn: /*p:foo*/A.()->/*p:foo*/Unit) {} +/*p:foo*/fun lambdaConsumer(fn: (/*p:foo*/A)->/*p:foo p:kotlin*/Unit) {} +/*p:foo*/fun extensionConsumer(fn: /*p:foo*/A.()->/*p:foo p:kotlin*/Unit) {} /*p:foo*/fun testLambdaParameterType() { /*p:foo*/lambdaConsumer /*p:kotlin(Function1) p:foo(A)*/{ /*p:foo(A)*/it } diff --git a/jps-plugin/testData/incremental/lookupTracker/java/usages.kt b/jps-plugin/testData/incremental/lookupTracker/java/usages.kt index 619d4d63969..fae7e925fd0 100644 --- a/jps-plugin/testData/incremental/lookupTracker/java/usages.kt +++ b/jps-plugin/testData/incremental/lookupTracker/java/usages.kt @@ -1,6 +1,6 @@ package foo -import bar./*p:bar*/C +/*p:bar(C)*/import bar.C import baz.* /*p:foo*/fun usages() { @@ -11,16 +11,16 @@ import baz.* /*p:bar(C)*/c./*c:bar.C*/func() /*p:bar(C) c:bar.C(B)*/c./*c:bar.C*/B() - /*p:foo p:baz p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:java.lang p:kotlin.jvm p:kotlin(String)*/C./*c:bar.C*/sfield - /*p:foo p:baz p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:java.lang p:kotlin.jvm p:kotlin(String)*/C./*c:bar.C*/sfield = /*p:kotlin(String)*/"new" - /*p:foo p:baz p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:java.lang p:kotlin.jvm*/C./*c:bar.C*/sfunc() - /*p:foo p:baz p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:java.lang p:kotlin.jvm c:bar.C(S)*/C./*c:bar.C*/S() + /*p:bar p:foo p:baz p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:java.lang p:kotlin.jvm p:kotlin(String)*/C./*c:bar.C*/sfield + /*p:bar p:foo p:baz p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:java.lang p:kotlin.jvm p:kotlin(String)*/C./*c:bar.C*/sfield = /*p:kotlin(String)*/"new" + /*p:bar p:foo p:baz p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:java.lang p:kotlin.jvm*/C./*c:bar.C*/sfunc() + /*p:bar p:foo p:baz p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:java.lang p:kotlin.jvm c:bar.C(S)*/C./*c:bar.C*/S() // inherited from I /*p:bar(C)*/c./*c:bar.C*/ifunc() - /*p:foo p:baz p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:java.lang p:kotlin.jvm p:kotlin(String)*/C./*c:bar.C*/isfield + /*p:bar p:foo p:baz p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:java.lang p:kotlin.jvm p:kotlin(String)*/C./*c:bar.C*/isfield // expected error: Unresolved reference: IS - /*p:foo p:baz p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:java.lang p:kotlin.jvm*/C./*c:bar.C*/IS() + /*p:bar p:foo p:baz p:kotlin p:kotlin.annotation p:kotlin.collections p:kotlin.ranges p:kotlin.sequences p:kotlin.text p:kotlin.io p:kotlin.comparisons p:java.lang p:kotlin.jvm*/C./*c:bar.C*/IS() val i: /*p:foo*/I = /*p:bar(C)*/c @@ -35,10 +35,10 @@ import baz.* } /*p:foo*/fun classifiers( - c: C, - b: C./*c:bar.C*/B, - s: C./*c:bar.C*/S, - cis: C./*c:bar.C*/IS, + c: /*p:bar*/C, + b: /*p:bar*/C./*c:bar.C*/B, + s: /*p:bar*/C./*c:bar.C*/S, + cis: /*p:bar*/C./*c:bar.C*/IS, i: /*p:foo*/I, iis: /*p:foo*/I./*c:foo.I*/IS, e: /*p:foo p:baz*/E diff --git a/jps-plugin/testData/incremental/lookupTracker/localDeclarations/locals.kt b/jps-plugin/testData/incremental/lookupTracker/localDeclarations/locals.kt index 8dc43de85c1..fa10ec53086 100644 --- a/jps-plugin/testData/incremental/lookupTracker/localDeclarations/locals.kt +++ b/jps-plugin/testData/incremental/lookupTracker/localDeclarations/locals.kt @@ -2,16 +2,16 @@ package local.declarations import bar.* -/*p:local.declarations*/fun f(p: /*p:local.declarations*/Any) /*p:kotlin(Int)*/{ +/*p:local.declarations*/fun f(p: /*p:local.declarations p:kotlin*/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*/Int.localExtFun() = /*p:kotlin(Int)*/localFun() + fun /*p:local.declarations p:kotlin*/Int.localExtFun() = /*p:kotlin(Int)*/localFun() abstract class LocalI { - abstract var a: /*p:local.declarations*/Int + abstract var a: /*p:local.declarations p:kotlin*/Int abstract fun foo() } diff --git a/jps-plugin/testData/incremental/lookupTracker/packageDeclarations/foo1.kt b/jps-plugin/testData/incremental/lookupTracker/packageDeclarations/foo1.kt index 2bbe33fe6de..222fadbf956 100644 --- a/jps-plugin/testData/incremental/lookupTracker/packageDeclarations/foo1.kt +++ b/jps-plugin/testData/incremental/lookupTracker/packageDeclarations/foo1.kt @@ -1,7 +1,7 @@ package foo import bar.* -import baz./*p:baz*/C +/*p:baz(C)*/import baz.C /*p:foo*/val a = /*p:foo p:bar*/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:java.lang p:kotlin.jvm*/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:java.lang p:kotlin.jvm p:baz(B)*/baz./*p:baz*/B() @@ -11,7 +11,7 @@ import baz./*p:baz*/C /*p:kotlin(Nothing)*/return /*p:foo p:bar*/B() } -/*p:foo*/fun /*p:foo*/MyClass.extFunc(p: /**p:foo p:bar*//*p:foo*/Array, e: /*p:foo*/MyEnum, c: /**???*/C): /*p:foo*/MyInterface /*p:kotlin(Nothing)*/{ +/*p:foo*/fun /*p:foo*/MyClass.extFunc(p: /**p:foo p:bar*//*p:foo p:kotlin*/Array, e: /*p:foo*/MyEnum, c: /**???*//*p:baz*/C): /*p:foo*/MyInterface /*p:kotlin(Nothing)*/{ /*c:foo.MyClass c:foo.MyClass(getB) 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:java.lang p:kotlin.jvm 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:java.lang p:kotlin.jvm*/MyClass() } diff --git a/jps-plugin/testData/incremental/lookupTracker/simple/main.kt b/jps-plugin/testData/incremental/lookupTracker/simple/main.kt index 33b7fbf143c..09f59f1743c 100644 --- a/jps-plugin/testData/incremental/lookupTracker/simple/main.kt +++ b/jps-plugin/testData/incremental/lookupTracker/simple/main.kt @@ -1,6 +1,6 @@ package foo.bar -/*p:foo.bar*/fun main(args: /*p:foo.bar*/Array) { - val f: /*p:foo.bar*/Array - val s: /*p:foo.bar*/String +/*p:foo.bar*/fun main(args: /*p:foo.bar p:kotlin*/Array) { + val f: /*p:foo.bar p:kotlin*/Array + val s: /*p:foo.bar p:kotlin*/String } diff --git a/jps-plugin/testData/incremental/lookupTracker/syntheticProperties/KotlinClass.kt b/jps-plugin/testData/incremental/lookupTracker/syntheticProperties/KotlinClass.kt index 75b360dbbb9..ac2ea2093d3 100644 --- a/jps-plugin/testData/incremental/lookupTracker/syntheticProperties/KotlinClass.kt +++ b/jps-plugin/testData/incremental/lookupTracker/syntheticProperties/KotlinClass.kt @@ -1,8 +1,8 @@ package foo -import /*p:*/JavaClass +/*p:(JavaClass)*/import JavaClass -/*p:foo*/class KotlinClass : JavaClass() { +/*p:foo*/class KotlinClass : /*p:*/JavaClass() { override fun getFoo() = /*p:kotlin(Int)*/2 - fun setFoo(i: /*c:foo.KotlinClass c:JavaClass p:foo*/Int) {} + fun setFoo(i: /*c:foo.KotlinClass c:JavaClass p:foo p:kotlin*/Int) {} } diff --git a/jps-plugin/testData/incremental/lookupTracker/syntheticProperties/usages.kt b/jps-plugin/testData/incremental/lookupTracker/syntheticProperties/usages.kt index 38edcec3ac5..6e90f036e0a 100644 --- a/jps-plugin/testData/incremental/lookupTracker/syntheticProperties/usages.kt +++ b/jps-plugin/testData/incremental/lookupTracker/syntheticProperties/usages.kt @@ -1,7 +1,7 @@ package foo.bar -import /*p:*/JavaClass -import foo./*p:foo*/KotlinClass +/*p:(JavaClass)*/import JavaClass +/*p:foo(KotlinClass)*/import foo.KotlinClass /*p:foo.bar*/fun test() { val j = /*p:*/JavaClass()