From 95ede7fb67227a64215e3be535c2b679aa2329e6 Mon Sep 17 00:00:00 2001 From: Mikhail Zarechenskiy Date: Tue, 2 May 2017 14:25:48 +0300 Subject: [PATCH] Move SAM adapters from static scope to synthetic one --- .../synthetic/JavaSyntheticPropertiesScope.kt | 10 ++--- .../synthetic/SamAdapterFunctionsScope.kt | 22 +++++++++- .../kotlin/resolve/calls/tower/TowerLevels.kt | 20 +++++++-- .../generic/dependOnArgumentType.txt | 1 - .../tests/j+k/ambiguousSamAdapters.txt | 2 - .../tests/j+k/sam/inheritedStaticSam.kt | 13 ++++++ .../tests/j+k/sam/inheritedStaticSam.txt | 19 +++++++++ .../j+k/sam/staticSamFromImportWithStar.kt | 17 ++++++++ .../j+k/sam/staticSamFromImportWithStar.txt | 5 +++ .../j+k/sam/staticSamWithExplicitImport.kt | 17 ++++++++ .../j+k/sam/staticSamWithExplicitImport.txt | 5 +++ .../genericInReturnType.txt | 2 - .../genericInValueParameter.txt | 2 - .../genericSuperWildcard.txt | 1 - .../starProjectionComplexUpperBound.txt | 1 - .../disallowForSamAdapterFunction.txt | 1 - .../platformTypes/noAnnotationInClassPath.txt | 1 - .../tests/platformTypes/rawSamOverrides.txt | 3 -- .../samAdapters/overloadResolutionStatic.txt | 2 - ...loadResolutionStaticWithoutRefinedSams.txt | 2 - .../resolve/samAgainstFunctionalType.kt | 29 +++++++++++++ .../resolve/samAgainstFunctionalType.txt | 42 +++++++++++++++++++ .../sam/DifferentParametersCount.txt | 3 -- .../compiledJava/sam/FakeStaticOverrides.java | 18 ++++++++ .../compiledJava/sam/FakeStaticOverrides.txt | 28 +++++++++++++ .../compiledJava/sam/StaticOverrides.txt | 1 - .../compiledJava/sam/adapters/Basic.txt | 1 - .../sam/adapters/SeveralSamParameters.txt | 1 - .../sam/adapters/TypeParameterOfMethod.txt | 3 -- .../checkers/DiagnosticsTestGenerated.java | 18 ++++++++ .../DiagnosticsTestWithStdLibGenerated.java | 6 +++ .../jvm/compiler/LoadJavaTestGenerated.java | 6 +++ ...JavaWithFastClassReadingTestGenerated.java | 6 +++ .../java/lazy/descriptors/LazyJavaScope.kt | 7 +--- .../descriptors/LazyJavaStaticClassScope.kt | 2 +- .../kotlin/resolve/scopes/SyntheticScopes.kt | 7 +++- .../caches/resolve/JavaResolveExtension.kt | 2 +- 37 files changed, 281 insertions(+), 45 deletions(-) create mode 100644 compiler/testData/diagnostics/tests/j+k/sam/inheritedStaticSam.kt create mode 100644 compiler/testData/diagnostics/tests/j+k/sam/inheritedStaticSam.txt create mode 100644 compiler/testData/diagnostics/tests/j+k/sam/staticSamFromImportWithStar.kt create mode 100644 compiler/testData/diagnostics/tests/j+k/sam/staticSamFromImportWithStar.txt create mode 100644 compiler/testData/diagnostics/tests/j+k/sam/staticSamWithExplicitImport.kt create mode 100644 compiler/testData/diagnostics/tests/j+k/sam/staticSamWithExplicitImport.txt create mode 100644 compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.kt create mode 100644 compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.txt create mode 100644 compiler/testData/loadJava/compiledJava/sam/FakeStaticOverrides.java create mode 100644 compiler/testData/loadJava/compiledJava/sam/FakeStaticOverrides.txt diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticPropertiesScope.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticPropertiesScope.kt index 6f469bbc019..4e94246a0da 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticPropertiesScope.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/JavaSyntheticPropertiesScope.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2016 JetBrains s.r.o. + * 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. @@ -29,10 +29,7 @@ import org.jetbrains.kotlin.incremental.record import org.jetbrains.kotlin.load.java.JvmAbi import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.resolve.DescriptorUtils -import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter -import org.jetbrains.kotlin.resolve.scopes.SyntheticScope -import org.jetbrains.kotlin.resolve.scopes.SyntheticScopes -import org.jetbrains.kotlin.resolve.scopes.collectSyntheticExtensionProperties +import org.jetbrains.kotlin.resolve.scopes.* import org.jetbrains.kotlin.storage.StorageManager import org.jetbrains.kotlin.types.* import org.jetbrains.kotlin.types.typeUtil.isSubtypeOf @@ -180,6 +177,9 @@ class JavaSyntheticPropertiesScope(storageManager: StorageManager, private val l } } + override fun getSyntheticStaticFunctions(scope: ResolutionScope, name: Name, location: LookupLocation): Collection + = emptyList() + private fun collectSyntheticPropertiesByName(result: SmartList?, type: TypeConstructor, name: Name, processedTypes: MutableSet?, location: LookupLocation): SmartList? { if (processedTypes != null && !processedTypes.add(type)) return result diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/SamAdapterFunctionsScope.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/SamAdapterFunctionsScope.kt index ae0b521d60d..2bff31e645e 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/SamAdapterFunctionsScope.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/synthetic/SamAdapterFunctionsScope.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2016 JetBrains s.r.o. + * 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. @@ -23,16 +23,20 @@ import org.jetbrains.kotlin.descriptors.annotations.Annotations import org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl import org.jetbrains.kotlin.descriptors.synthetic.SyntheticMemberDescriptor import org.jetbrains.kotlin.incremental.components.LookupLocation +import org.jetbrains.kotlin.load.java.descriptors.JavaMethodDescriptor +import org.jetbrains.kotlin.load.java.descriptors.SamAdapterDescriptor import org.jetbrains.kotlin.load.java.sam.SingleAbstractMethodUtils import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.resolve.calls.inference.wrapWithCapturingSubstitution import org.jetbrains.kotlin.resolve.isHiddenInResolution import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter +import org.jetbrains.kotlin.resolve.scopes.ResolutionScope import org.jetbrains.kotlin.resolve.scopes.SyntheticScope import org.jetbrains.kotlin.storage.StorageManager import org.jetbrains.kotlin.types.* import org.jetbrains.kotlin.types.checker.findCorrespondingSupertype import java.util.* +import kotlin.collections.LinkedHashSet import kotlin.properties.Delegates interface SamAdapterExtensionFunctionDescriptor : FunctionDescriptor, SyntheticMemberDescriptor { @@ -47,6 +51,11 @@ class SamAdapterFunctionsScope( extensionForFunctionNotCached(function) } + private val samAdapterForStaticFunction = + storageManager.createMemoizedFunctionWithNullableValues> { function -> + samAdapterForFunctionNotCached(function) + } + private fun extensionForFunctionNotCached(function: FunctionDescriptor): FunctionDescriptor? { if (!function.visibility.isVisibleOutside()) return null if (!function.hasJavaOriginInHierarchy()) return null //TODO: should we go into base at all? @@ -56,6 +65,13 @@ class SamAdapterFunctionsScope( return MyFunctionDescriptor.create(function) } + private fun samAdapterForFunctionNotCached(function: DeclarationDescriptor): SamAdapterDescriptor? { + if (function !is JavaMethodDescriptor) return null + if (function.dispatchReceiverParameter != null) return null // consider only statics + if (!SingleAbstractMethodUtils.isSamAdapterNecessary(function)) return null + return SingleAbstractMethodUtils.createSamAdapterFunction(function) + } + override fun getSyntheticMemberFunctions(receiverTypes: Collection, name: Name, location: LookupLocation): Collection { var result: SmartList? = null for (type in receiverTypes) { @@ -102,6 +118,10 @@ class SamAdapterFunctionsScope( override fun getSyntheticExtensionProperties(receiverTypes: Collection): Collection = emptyList() + override fun getSyntheticStaticFunctions(scope: ResolutionScope, name: Name, location: LookupLocation): Collection { + return scope.getContributedFunctions(name, location).mapNotNull { samAdapterForStaticFunction(it) } + } + private class MyFunctionDescriptor( containingDeclaration: DeclarationDescriptor, original: SimpleFunctionDescriptor?, diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/tower/TowerLevels.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/tower/TowerLevels.kt index 748ac67af21..f00931abe27 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/tower/TowerLevels.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/tower/TowerLevels.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2016 JetBrains s.r.o. + * 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. @@ -161,7 +161,11 @@ internal class QualifierScopeTowerLevel(scopeTower: ImplicitScopeTower, val qual } override fun getFunctions(name: Name, extensionReceiver: ReceiverValueWithSmartCastInfo?) = qualifier.staticScope - .getContributedFunctionsAndConstructors(name, location, scopeTower.syntheticConstructorsProvider).map { + .getContributedFunctionsAndConstructors(name, + location, + scopeTower.syntheticConstructorsProvider, + scopeTower.syntheticScopes, + qualifier.staticScope).map { createCandidateDescriptor(it, dispatchReceiver = null) } } @@ -185,7 +189,11 @@ internal open class ScopeBasedTowerLevel protected constructor( } override fun getFunctions(name: Name, extensionReceiver: ReceiverValueWithSmartCastInfo?): Collection - = resolutionScope.getContributedFunctionsAndConstructors(name, location, scopeTower.syntheticConstructorsProvider).map { + = resolutionScope.getContributedFunctionsAndConstructors(name, + location, + scopeTower.syntheticConstructorsProvider, + scopeTower.syntheticScopes, + resolutionScope).map { createCandidateDescriptor(it, dispatchReceiver = null) } } @@ -263,7 +271,9 @@ private fun KotlinType?.getInnerConstructors(name: Name, location: LookupLocatio private fun ResolutionScope.getContributedFunctionsAndConstructors( name: Name, location: LookupLocation, - syntheticConstructorsProvider: SyntheticConstructorsProvider + syntheticConstructorsProvider: SyntheticConstructorsProvider, + syntheticScopes: SyntheticScopes, + scope: ResolutionScope ): Collection { val result = ArrayList(getContributedFunctions(name, location)) @@ -273,6 +283,8 @@ private fun ResolutionScope.getContributedFunctionsAndConstructors( syntheticConstructorsProvider.getSyntheticConstructors(classifier, location).filterTo(result) { it.dispatchReceiverParameter == null } } + result.addAll(syntheticScopes.collectSyntheticStaticFunctions(scope, name, location)) + return result.toList() } diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/dependOnArgumentType.txt b/compiler/testData/diagnostics/tests/callableReference/generic/dependOnArgumentType.txt index be9d1228a12..6eed976d3f9 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/dependOnArgumentType.txt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/dependOnArgumentType.txt @@ -13,6 +13,5 @@ public open class A { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String // Static members - public final /*synthesized*/ fun invokeLater(/*0*/ doRun: (() -> kotlin.Unit)!): kotlin.Unit public open fun invokeLater(/*0*/ doRun: java.lang.Runnable!): kotlin.Unit } diff --git a/compiler/testData/diagnostics/tests/j+k/ambiguousSamAdapters.txt b/compiler/testData/diagnostics/tests/j+k/ambiguousSamAdapters.txt index 44ed746bda7..7716b9fce38 100644 --- a/compiler/testData/diagnostics/tests/j+k/ambiguousSamAdapters.txt +++ b/compiler/testData/diagnostics/tests/j+k/ambiguousSamAdapters.txt @@ -9,8 +9,6 @@ public open class A { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String // Static members - public final /*synthesized*/ fun foo(/*0*/ c: (() -> kotlin.Unit)!): kotlin.Unit - public final /*synthesized*/ fun foo(/*0*/ r: (() -> kotlin.Unit)!): kotlin.Unit public open fun foo(/*0*/ c: java.io.Closeable!): kotlin.Unit public open fun foo(/*0*/ r: java.lang.Runnable!): kotlin.Unit } diff --git a/compiler/testData/diagnostics/tests/j+k/sam/inheritedStaticSam.kt b/compiler/testData/diagnostics/tests/j+k/sam/inheritedStaticSam.kt new file mode 100644 index 00000000000..0779d3ced95 --- /dev/null +++ b/compiler/testData/diagnostics/tests/j+k/sam/inheritedStaticSam.kt @@ -0,0 +1,13 @@ +// FILE: Statics.java + +public class Statics { + public static void foo(Runnable r) {} +} + +// FILE: test.kt + +class A : Statics() { + fun test() { + foo {} + } +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/sam/inheritedStaticSam.txt b/compiler/testData/diagnostics/tests/j+k/sam/inheritedStaticSam.txt new file mode 100644 index 00000000000..b9facd55255 --- /dev/null +++ b/compiler/testData/diagnostics/tests/j+k/sam/inheritedStaticSam.txt @@ -0,0 +1,19 @@ +package + +public final class A : Statics { + public constructor A() + 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 final fun test(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +public open class Statics { + public constructor Statics() + 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 + + // Static members + public open fun foo(/*0*/ r: java.lang.Runnable!): kotlin.Unit +} diff --git a/compiler/testData/diagnostics/tests/j+k/sam/staticSamFromImportWithStar.kt b/compiler/testData/diagnostics/tests/j+k/sam/staticSamFromImportWithStar.kt new file mode 100644 index 00000000000..b299377a168 --- /dev/null +++ b/compiler/testData/diagnostics/tests/j+k/sam/staticSamFromImportWithStar.kt @@ -0,0 +1,17 @@ +// FILE: a/Statics.java + +package a; + +public class Statics { + public static void foo(Runnable r) {} +} + +// FILE: test.kt + +package b + +import a.Statics.* + +fun test() { + foo {} +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/sam/staticSamFromImportWithStar.txt b/compiler/testData/diagnostics/tests/j+k/sam/staticSamFromImportWithStar.txt new file mode 100644 index 00000000000..f725186033d --- /dev/null +++ b/compiler/testData/diagnostics/tests/j+k/sam/staticSamFromImportWithStar.txt @@ -0,0 +1,5 @@ +package + +package b { + public fun test(): kotlin.Unit +} diff --git a/compiler/testData/diagnostics/tests/j+k/sam/staticSamWithExplicitImport.kt b/compiler/testData/diagnostics/tests/j+k/sam/staticSamWithExplicitImport.kt new file mode 100644 index 00000000000..8c551eed7b3 --- /dev/null +++ b/compiler/testData/diagnostics/tests/j+k/sam/staticSamWithExplicitImport.kt @@ -0,0 +1,17 @@ +// FILE: a/Statics.java + +package a; + +public class Statics { + public static void foo(Runnable r) {} +} + +// FILE: test.kt + +package b; + +import a.Statics.foo + +fun test() { + foo {} +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/sam/staticSamWithExplicitImport.txt b/compiler/testData/diagnostics/tests/j+k/sam/staticSamWithExplicitImport.txt new file mode 100644 index 00000000000..f725186033d --- /dev/null +++ b/compiler/testData/diagnostics/tests/j+k/sam/staticSamWithExplicitImport.txt @@ -0,0 +1,5 @@ +package + +package b { + public fun test(): kotlin.Unit +} diff --git a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInReturnType.txt b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInReturnType.txt index f0e60980aa2..85696f75288 100644 --- a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInReturnType.txt +++ b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInReturnType.txt @@ -11,9 +11,7 @@ public open class A { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String // Static members - public final /*synthesized*/ fun bar(/*0*/ l: ((x: kotlin.String!) -> kotlin.Any!)!): kotlin.Unit public open fun bar(/*0*/ l: EventListener<*>!): kotlin.Unit - public final /*synthesized*/ fun baz(/*0*/ l: ((x: kotlin.String!) -> kotlin.CharSequence!)!): kotlin.Unit public open fun baz(/*0*/ l: EventListener!): kotlin.Unit } diff --git a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInValueParameter.txt b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInValueParameter.txt index b269406c1a9..91ba446dde1 100644 --- a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInValueParameter.txt +++ b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericInValueParameter.txt @@ -11,9 +11,7 @@ public open class A { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String // Static members - public final /*synthesized*/ fun bar(/*0*/ l: ((e: kotlin.Any!) -> kotlin.Unit)!): kotlin.Unit public open fun bar(/*0*/ l: EventListener<*>!): kotlin.Unit - public final /*synthesized*/ fun baz(/*0*/ l: ((e: kotlin.CharSequence!) -> kotlin.Unit)!): kotlin.Unit public open fun baz(/*0*/ l: EventListener!): kotlin.Unit } diff --git a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericSuperWildcard.txt b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericSuperWildcard.txt index e5675b5a629..90fdd75a881 100644 --- a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericSuperWildcard.txt +++ b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/genericSuperWildcard.txt @@ -11,7 +11,6 @@ public open class A { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String // Static members - public final /*synthesized*/ fun bar(/*0*/ l: ((e: kotlin.String!) -> kotlin.Unit)!): kotlin.Unit public open fun bar(/*0*/ l: EventListener!): kotlin.Unit } diff --git a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/starProjectionComplexUpperBound.txt b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/starProjectionComplexUpperBound.txt index 351d461d23b..5b720def9ea 100644 --- a/compiler/testData/diagnostics/tests/j+k/samByProjectedType/starProjectionComplexUpperBound.txt +++ b/compiler/testData/diagnostics/tests/j+k/samByProjectedType/starProjectionComplexUpperBound.txt @@ -11,7 +11,6 @@ public open class A { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String // Static members - public final /*synthesized*/ fun bar(/*0*/ l: ((e: kotlin.collections.(Mutable)Map!) -> kotlin.CharSequence!)!): kotlin.Unit public open fun bar(/*0*/ l: Function<*, *>!): kotlin.Unit } diff --git a/compiler/testData/diagnostics/tests/namedArguments/disallowForSamAdapterFunction.txt b/compiler/testData/diagnostics/tests/namedArguments/disallowForSamAdapterFunction.txt index bf107a5bb5b..0c3652ac351 100644 --- a/compiler/testData/diagnostics/tests/namedArguments/disallowForSamAdapterFunction.txt +++ b/compiler/testData/diagnostics/tests/namedArguments/disallowForSamAdapterFunction.txt @@ -10,7 +10,6 @@ package test { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String // Static members - public final /*synthesized*/ fun foo(/*0*/ s: kotlin.String!, /*1*/ r: (() -> kotlin.Unit)!, /*2*/ z: kotlin.Boolean!): kotlin.Unit public open fun foo(/*0*/ s: kotlin.String!, /*1*/ r: java.lang.Runnable!, /*2*/ z: kotlin.Boolean!): kotlin.Unit } } diff --git a/compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.txt b/compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.txt index 1facb74e790..513618368dd 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.txt +++ b/compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.txt @@ -17,6 +17,5 @@ public open class B { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String // Static members - public final /*synthesized*/ fun bar(/*0*/ y: ((y: kotlin.String?) -> kotlin.Boolean)!): kotlin.Unit public open fun bar(/*0*/ y: A!): kotlin.Unit } diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawSamOverrides.txt b/compiler/testData/diagnostics/tests/platformTypes/rawSamOverrides.txt index 44f82e8b786..bd074c30e65 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/rawSamOverrides.txt +++ b/compiler/testData/diagnostics/tests/platformTypes/rawSamOverrides.txt @@ -33,13 +33,10 @@ public abstract class C { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String // Static members - public final override /*1*/ /*fake_override*/ fun aStaticMethod(/*0*/ x: T!, /*1*/ y: ((x: T!) -> kotlin.Unit)!): kotlin.Unit - public final /*synthesized*/ fun aStaticMethod(/*0*/ x: kotlin.Any!, /*1*/ y: ((x: kotlin.Any!) -> kotlin.Unit)!): kotlin.Unit public open fun aStaticMethod(/*0*/ x: kotlin.Any!, /*1*/ y: Fun<(raw) kotlin.Any!>!): kotlin.Unit } // Static members - public final /*synthesized*/ fun aStaticMethod(/*0*/ x: T!, /*1*/ y: ((x: T!) -> kotlin.Unit)!): kotlin.Unit public open fun aStaticMethod(/*0*/ x: T!, /*1*/ y: Fun!): kotlin.Unit } diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStatic.txt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStatic.txt index 91eb6e2de87..a516e5db213 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStatic.txt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStatic.txt @@ -10,10 +10,8 @@ public open class A { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String // Static members - public final /*synthesized*/ fun bar(/*0*/ r: (() -> kotlin.Unit)!): kotlin.Int public open fun bar(/*0*/ r: java.lang.Runnable!): kotlin.Int public open fun bar(/*0*/ r: kotlin.CharSequence!): kotlin.String! - public final /*synthesized*/ fun foo(/*0*/ r: (() -> kotlin.Unit)!): kotlin.Int public open fun foo(/*0*/ r: java.lang.Runnable!): kotlin.Int public open fun foo(/*0*/ r: kotlin.Any!): kotlin.String! } diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStaticWithoutRefinedSams.txt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStaticWithoutRefinedSams.txt index 91eb6e2de87..a516e5db213 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStaticWithoutRefinedSams.txt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStaticWithoutRefinedSams.txt @@ -10,10 +10,8 @@ public open class A { public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String // Static members - public final /*synthesized*/ fun bar(/*0*/ r: (() -> kotlin.Unit)!): kotlin.Int public open fun bar(/*0*/ r: java.lang.Runnable!): kotlin.Int public open fun bar(/*0*/ r: kotlin.CharSequence!): kotlin.String! - public final /*synthesized*/ fun foo(/*0*/ r: (() -> kotlin.Unit)!): kotlin.Int public open fun foo(/*0*/ r: java.lang.Runnable!): kotlin.Int public open fun foo(/*0*/ r: kotlin.Any!): kotlin.String! } diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.kt new file mode 100644 index 00000000000..8b2f3adab2f --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.kt @@ -0,0 +1,29 @@ +// !CHECK_TYPE + +// FILE: StaticOverrides.java + +import kotlin.Unit; +import kotlin.jvm.functions.Function0; + +public class StaticOverrides { + public static class A { + public static int foo(Runnable x) { return 0; } + public static boolean foo(Function0 x) { return true; } + } + + public static class B { + public static String foo(Runnable x) { return ""; } + } + + public static class C extends A { + public static String foo(Runnable x) { return ""; } + } +} + +// FILE: test.kt + +fun test() { + StaticOverrides.A.foo {} checkType { _() } + StaticOverrides.B.foo {} checkType { _() } + StaticOverrides.C.foo {} checkType { _() } +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.txt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.txt new file mode 100644 index 00000000000..777fcf5949e --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.txt @@ -0,0 +1,42 @@ +package + +public fun test(): kotlin.Unit + +public open class StaticOverrides { + public constructor StaticOverrides() + 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 A { + public constructor A() + 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 + + // Static members + public open fun foo(/*0*/ x: (() -> kotlin.Unit!)!): kotlin.Boolean + public open fun foo(/*0*/ x: java.lang.Runnable!): kotlin.Int + } + + public open class B { + public constructor B() + 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 + + // Static members + public open fun foo(/*0*/ x: java.lang.Runnable!): kotlin.String! + } + + public open class C : StaticOverrides.A { + public constructor C() + 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 + + // Static members + public open override /*1*/ /*fake_override*/ fun foo(/*0*/ x: (() -> kotlin.Unit!)!): kotlin.Boolean + public open fun foo(/*0*/ x: java.lang.Runnable!): kotlin.String! + } +} diff --git a/compiler/testData/loadJava/compiledJava/sam/DifferentParametersCount.txt b/compiler/testData/loadJava/compiledJava/sam/DifferentParametersCount.txt index 00de75917a5..15f91f79183 100644 --- a/compiler/testData/loadJava/compiledJava/sam/DifferentParametersCount.txt +++ b/compiler/testData/loadJava/compiledJava/sam/DifferentParametersCount.txt @@ -7,7 +7,6 @@ public final class DifferentParametersCount { public constructor A() // Static members - public final /*synthesized*/ fun foo(/*0*/ p0: (() -> kotlin.Unit)!, /*1*/ p1: kotlin.Int): kotlin.Unit public open fun foo(/*0*/ p0: java.lang.Runnable!, /*1*/ p1: kotlin.Int): kotlin.Unit } @@ -15,8 +14,6 @@ public final class DifferentParametersCount { public constructor B() // Static members - public final /*synthesized*/ fun foo(/*0*/ p0: (() -> kotlin.Unit)!): kotlin.Unit - public final override /*1*/ /*fake_override*/ fun foo(/*0*/ p0: (() -> kotlin.Unit)!, /*1*/ p1: kotlin.Int): kotlin.Unit public open fun foo(/*0*/ p0: java.lang.Runnable!): kotlin.Unit public open override /*1*/ /*fake_override*/ fun foo(/*0*/ p0: java.lang.Runnable!, /*1*/ p1: kotlin.Int): kotlin.Unit } diff --git a/compiler/testData/loadJava/compiledJava/sam/FakeStaticOverrides.java b/compiler/testData/loadJava/compiledJava/sam/FakeStaticOverrides.java new file mode 100644 index 00000000000..ebf6d11e681 --- /dev/null +++ b/compiler/testData/loadJava/compiledJava/sam/FakeStaticOverrides.java @@ -0,0 +1,18 @@ +package test; + +import kotlin.Unit; +import kotlin.jvm.functions.Function0; + +public final class FakeStaticOverrides { + public static class A { + static public void foo(Function0 x) {} + } + + public static class B extends A { + // SAM adapter should not override A.foo + static public void foo(Runnable x) {} + } + + public static class C extends B { + } +} diff --git a/compiler/testData/loadJava/compiledJava/sam/FakeStaticOverrides.txt b/compiler/testData/loadJava/compiledJava/sam/FakeStaticOverrides.txt new file mode 100644 index 00000000000..767e825cfb6 --- /dev/null +++ b/compiler/testData/loadJava/compiledJava/sam/FakeStaticOverrides.txt @@ -0,0 +1,28 @@ +package test + +public final class FakeStaticOverrides { + public constructor FakeStaticOverrides() + + public open class A { + public constructor A() + + // Static members + public open fun foo(/*0*/ p0: (() -> kotlin.Unit!)!): kotlin.Unit + } + + public open class B : test.FakeStaticOverrides.A { + public constructor B() + + // Static members + public open override /*1*/ /*fake_override*/ fun foo(/*0*/ p0: (() -> kotlin.Unit!)!): kotlin.Unit + public open fun foo(/*0*/ p0: java.lang.Runnable!): kotlin.Unit + } + + public open class C : test.FakeStaticOverrides.B { + public constructor C() + + // Static members + public open override /*1*/ /*fake_override*/ fun foo(/*0*/ p0: (() -> kotlin.Unit!)!): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun foo(/*0*/ p0: java.lang.Runnable!): kotlin.Unit + } +} diff --git a/compiler/testData/loadJava/compiledJava/sam/StaticOverrides.txt b/compiler/testData/loadJava/compiledJava/sam/StaticOverrides.txt index 0cc20700498..a9961d76290 100644 --- a/compiler/testData/loadJava/compiledJava/sam/StaticOverrides.txt +++ b/compiler/testData/loadJava/compiledJava/sam/StaticOverrides.txt @@ -15,7 +15,6 @@ public final class StaticOverrides { // Static members public open override /*1*/ /*fake_override*/ fun foo(/*0*/ p0: (() -> kotlin.Unit!)!): kotlin.Unit - public final /*synthesized*/ fun foo(/*0*/ p0: (() -> kotlin.Unit)!): kotlin.Unit public open fun foo(/*0*/ p0: java.lang.Runnable!): kotlin.Unit } } diff --git a/compiler/testData/loadJava/compiledJava/sam/adapters/Basic.txt b/compiler/testData/loadJava/compiledJava/sam/adapters/Basic.txt index c2b48a722bf..db5225b43fe 100644 --- a/compiler/testData/loadJava/compiledJava/sam/adapters/Basic.txt +++ b/compiler/testData/loadJava/compiledJava/sam/adapters/Basic.txt @@ -5,6 +5,5 @@ public open class Basic { public open fun foo(/*0*/ p0: java.lang.Runnable!): kotlin.Unit // Static members - public final /*synthesized*/ fun bar(/*0*/ p0: (() -> kotlin.Unit)!): kotlin.Unit public open fun bar(/*0*/ p0: java.lang.Runnable!): kotlin.Unit } diff --git a/compiler/testData/loadJava/compiledJava/sam/adapters/SeveralSamParameters.txt b/compiler/testData/loadJava/compiledJava/sam/adapters/SeveralSamParameters.txt index a891dcc7f49..304215be992 100644 --- a/compiler/testData/loadJava/compiledJava/sam/adapters/SeveralSamParameters.txt +++ b/compiler/testData/loadJava/compiledJava/sam/adapters/SeveralSamParameters.txt @@ -4,6 +4,5 @@ public open class SeveralSamParameters { public constructor SeveralSamParameters() // Static members - public final /*synthesized*/ fun findMaxAndInvokeCallback(/*0*/ p0: ((kotlin.String!, kotlin.String!) -> kotlin.Int)!, /*1*/ p1: kotlin.String!, /*2*/ p2: kotlin.String!, /*3*/ p3: (() -> kotlin.Unit)!): kotlin.String! public open fun findMaxAndInvokeCallback(/*0*/ p0: java.util.Comparator!, /*1*/ p1: kotlin.String!, /*2*/ p2: kotlin.String!, /*3*/ p3: java.lang.Runnable!): kotlin.String! } diff --git a/compiler/testData/loadJava/compiledJava/sam/adapters/TypeParameterOfMethod.txt b/compiler/testData/loadJava/compiledJava/sam/adapters/TypeParameterOfMethod.txt index 167804499ed..d4ced2e6dfe 100644 --- a/compiler/testData/loadJava/compiledJava/sam/adapters/TypeParameterOfMethod.txt +++ b/compiler/testData/loadJava/compiledJava/sam/adapters/TypeParameterOfMethod.txt @@ -4,10 +4,7 @@ public open class TypeParameterOfMethod { public constructor TypeParameterOfMethod() // Static members - public final /*synthesized*/ fun max(/*0*/ p0: ((T!, T!) -> kotlin.Int)!, /*1*/ p1: T!, /*2*/ p2: T!): T! public open fun max(/*0*/ p0: java.util.Comparator!, /*1*/ p1: T!, /*2*/ p2: T!): T! - public final /*synthesized*/ fun max2(/*0*/ p0: ((T!, T!) -> kotlin.Int)!, /*1*/ p1: T!, /*2*/ p2: T!): T! public open fun max2(/*0*/ p0: java.util.Comparator!, /*1*/ p1: T!, /*2*/ p2: T!): T! - public final /*synthesized*/ fun !> method(/*0*/ p0: ((A!, A!) -> kotlin.Int)!, /*1*/ p1: B!): kotlin.Unit public open fun !> method(/*0*/ p0: java.util.Comparator!, /*1*/ p1: B!): kotlin.Unit } diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java index 4df866bf52e..d21ca4a45a5 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java @@ -12489,12 +12489,30 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest { doTest(fileName); } + @TestMetadata("inheritedStaticSam.kt") + public void testInheritedStaticSam() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/j+k/sam/inheritedStaticSam.kt"); + doTest(fileName); + } + @TestMetadata("samOnTypeParameter.kt") public void testSamOnTypeParameter() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/j+k/sam/samOnTypeParameter.kt"); doTest(fileName); } + @TestMetadata("staticSamFromImportWithStar.kt") + public void testStaticSamFromImportWithStar() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/j+k/sam/staticSamFromImportWithStar.kt"); + doTest(fileName); + } + + @TestMetadata("staticSamWithExplicitImport.kt") + public void testStaticSamWithExplicitImport() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/j+k/sam/staticSamWithExplicitImport.kt"); + doTest(fileName); + } + @TestMetadata("typeInferenceOnSamAdapters.kt") public void testTypeInferenceOnSamAdapters() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/j+k/sam/typeInferenceOnSamAdapters.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java index e3386374d88..46644d68d6a 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java @@ -1613,6 +1613,12 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW doTest(fileName); } + @TestMetadata("samAgainstFunctionalType.kt") + public void testSamAgainstFunctionalType() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.kt"); + doTest(fileName); + } + @TestMetadata("samConstructorVsFun.kt") public void testSamConstructorVsFun() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/resolve/samConstructorVsFun.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaTestGenerated.java index 68adfe669fd..deb6be8a3c8 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaTestGenerated.java @@ -1357,6 +1357,12 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest { doTestCompiledJava(fileName); } + @TestMetadata("FakeStaticOverrides.java") + public void testFakeStaticOverrides() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/FakeStaticOverrides.java"); + doTestCompiledJava(fileName); + } + @TestMetadata("FilenameFilter.java") public void testFilenameFilter() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/FilenameFilter.java"); diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaWithFastClassReadingTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaWithFastClassReadingTestGenerated.java index 00d42f30305..7a2ef1b8409 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaWithFastClassReadingTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaWithFastClassReadingTestGenerated.java @@ -1355,6 +1355,12 @@ public class LoadJavaWithFastClassReadingTestGenerated extends AbstractLoadJavaW doTestCompiledJava(fileName); } + @TestMetadata("FakeStaticOverrides.java") + public void testFakeStaticOverrides() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/FakeStaticOverrides.java"); + doTestCompiledJava(fileName); + } + @TestMetadata("FilenameFilter.java") public void testFilenameFilter() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/sam/FilenameFilter.java"); diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaScope.kt b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaScope.kt index fb38129ec27..afe670cad15 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaScope.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaScope.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2016 JetBrains s.r.o. + * 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. @@ -67,7 +67,7 @@ abstract class LazyJavaScope(protected val c: LazyJavaResolverContext) : MemberS protected abstract fun computeMemberIndex(): DeclaredMemberIndex - // Fake overrides, SAM constructors/adapters, values()/valueOf(), etc. + // Fake overrides, values()/valueOf(), etc. protected abstract fun computeNonDeclaredFunctions(result: MutableCollection, name: Name) protected abstract fun getDispatchReceiverParameter(): ReceiverParameterDescriptor? @@ -82,9 +82,6 @@ abstract class LazyJavaScope(protected val c: LazyJavaResolverContext) : MemberS c.components.javaResolverCache.recordMethod(method, descriptor) result.add(descriptor) - if (method.isStatic) { - result.addIfNotNull(c.components.samConversionResolver.resolveSamAdapter(descriptor)) - } } result.retainMostSpecificInEachOverridableGroup() diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaStaticClassScope.kt b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaStaticClassScope.kt index b8d3bc10c29..f1df772183c 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaStaticClassScope.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaStaticClassScope.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2015 JetBrains s.r.o. + * 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. diff --git a/core/descriptors/src/org/jetbrains/kotlin/resolve/scopes/SyntheticScopes.kt b/core/descriptors/src/org/jetbrains/kotlin/resolve/scopes/SyntheticScopes.kt index adb456006eb..a5c9dba0b9a 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/resolve/scopes/SyntheticScopes.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/resolve/scopes/SyntheticScopes.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2015 JetBrains s.r.o. + * 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. @@ -27,6 +27,8 @@ interface SyntheticScope { fun getSyntheticExtensionProperties(receiverTypes: Collection, name: Name, location: LookupLocation): Collection fun getSyntheticMemberFunctions(receiverTypes: Collection, name: Name, location: LookupLocation): Collection + fun getSyntheticStaticFunctions(scope: ResolutionScope, name: Name, location: LookupLocation): Collection + fun getSyntheticExtensionProperties(receiverTypes: Collection): Collection fun getSyntheticMemberFunctions(receiverTypes: Collection): Collection } @@ -46,6 +48,9 @@ fun SyntheticScopes.collectSyntheticExtensionProperties(receiverTypes: Collectio fun SyntheticScopes.collectSyntheticMemberFunctions(receiverTypes: Collection, name: Name, location: LookupLocation) = scopes.flatMap { it.getSyntheticMemberFunctions(receiverTypes, name, location) } +fun SyntheticScopes.collectSyntheticStaticFunctions(scope: ResolutionScope, name: Name, location: LookupLocation) + = scopes.flatMap { it.getSyntheticStaticFunctions(scope, name, location) } + fun SyntheticScopes.collectSyntheticExtensionProperties(receiverTypes: Collection) = scopes.flatMap { it.getSyntheticExtensionProperties(receiverTypes) } diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/JavaResolveExtension.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/JavaResolveExtension.kt index 29376a7a7ab..534d2629de3 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/JavaResolveExtension.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/JavaResolveExtension.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2016 JetBrains s.r.o. + * 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.