Move SAM constructors to synthetic scope

This commit is contained in:
Mikhail Zarechenskiy
2017-05-04 02:20:14 +03:00
parent 429f0e4f68
commit 7541a3754d
100 changed files with 18 additions and 228 deletions
@@ -25,6 +25,8 @@ 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.descriptors.SamConstructorDescriptor
import org.jetbrains.kotlin.load.java.lazy.descriptors.LazyJavaClassDescriptor
import org.jetbrains.kotlin.load.java.sam.SingleAbstractMethodUtils
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.resolve.calls.inference.wrapWithCapturingSubstitution
@@ -56,6 +58,11 @@ class SamAdapterFunctionsScope(
samAdapterForFunctionNotCached(function)
}
private val samConstructorForClassifier =
storageManager.createMemoizedFunctionWithNullableValues<ClassifierDescriptor, SamConstructorDescriptor> { classifier ->
samConstructorForClassifierNotCached(classifier)
}
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?
@@ -72,6 +79,13 @@ class SamAdapterFunctionsScope(
return SingleAbstractMethodUtils.createSamAdapterFunction(function)
}
private fun samConstructorForClassifierNotCached(classifier: ClassifierDescriptor): SamConstructorDescriptor? {
return if (classifier is LazyJavaClassDescriptor && classifier.functionTypeForSamInterface != null) {
SingleAbstractMethodUtils.createSamConstructorFunction(classifier.containingDeclaration, classifier)
}
else null
}
override fun getSyntheticMemberFunctions(receiverTypes: Collection<KotlinType>, name: Name, location: LookupLocation): Collection<FunctionDescriptor> {
var result: SmartList<FunctionDescriptor>? = null
for (type in receiverTypes) {
@@ -119,7 +133,8 @@ class SamAdapterFunctionsScope(
override fun getSyntheticExtensionProperties(receiverTypes: Collection<KotlinType>): Collection<PropertyDescriptor> = emptyList()
override fun getSyntheticStaticFunctions(scope: ResolutionScope, name: Name, location: LookupLocation): Collection<FunctionDescriptor> {
return scope.getContributedFunctions(name, location).mapNotNull { samAdapterForStaticFunction(it) }
val samConstructor = scope.getContributedClassifier(name, location)?.let { samConstructorForClassifier(it) }
return scope.getContributedFunctions(name, location).mapNotNull { samAdapterForStaticFunction(it) } + listOfNotNull(samConstructor)
}
override fun getSyntheticStaticFunctions(scope: ResolutionScope): Collection<FunctionDescriptor> {
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun J(/*0*/ function: () -> kotlin.String!): J
public fun f1(/*0*/ x: kotlin.Int?): kotlin.Any
public fun </*0*/ T> f2(/*0*/ t: T): kotlin.Any
public fun </*0*/ S : kotlin.String?> f3(/*0*/ s: S): kotlin.Any
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun J(/*0*/ function: () -> kotlin.String!): J
public fun f1(/*0*/ x: kotlin.Int?): kotlin.Any
public fun </*0*/ T> f2(/*0*/ t: T): kotlin.Any
public fun </*0*/ S : kotlin.String?> f3(/*0*/ s: S): kotlin.Any
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun A(/*0*/ function: () -> kotlin.Int): A
public fun foo(): kotlin.Unit
public interface A {
@@ -24,9 +23,4 @@ public open class B {
public/*package*/ interface B3 {
public abstract fun getFoo(): kotlin.Int
}
// Static members
public/*package*/ final /*synthesized*/ fun B1(/*0*/ function: () -> kotlin.Int): B.B1
public/*package*/ final /*synthesized*/ fun B2(/*0*/ function: () -> kotlin.Int): B.B2
public/*package*/ final /*synthesized*/ fun B3(/*0*/ function: () -> kotlin.Int): B.B3
}
@@ -5,9 +5,6 @@ public interface A {
public interface B {
public abstract fun getFoo(): kotlin.Int
}
// Static members
public final /*synthesized*/ fun B(/*0*/ function: () -> kotlin.Int): A.B
}
public interface A0 {
@@ -18,9 +15,6 @@ public interface A0 {
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
// Static members
public final /*synthesized*/ fun B(/*0*/ function: () -> kotlin.Int): A0.B
}
public open class B {
@@ -1,8 +1,5 @@
package
public/*package*/ /*synthesized*/ fun A(/*0*/ function: () -> kotlin.Unit): A
public/*package*/ /*synthesized*/ fun C(/*0*/ function: () -> kotlin.Unit): C
public/*package*/ interface A {
public abstract fun foo(): kotlin.Unit
}
@@ -13,9 +13,6 @@ public/*package*/ open class LockBasedStorageManager {
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
// Static members
public/*package*/ final /*synthesized*/ fun ExceptionHandlingStrategy(/*0*/ function: () -> kotlin.Unit): LockBasedStorageManager.ExceptionHandlingStrategy
}
public interface StorageManager {
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun </*0*/ T : kotlin.CharSequence!> Predicate(/*0*/ function: (t: T) -> kotlin.Boolean): Predicate<T>
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
public fun process(/*0*/ x: Predicate<kotlin.String>): kotlin.Unit
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun A(/*0*/ function: () -> kotlin.String!): A
public fun </*0*/ T : B> test(/*0*/ x: T): kotlin.Unit where T : A, T : C
public interface A {
-1
View File
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun Run(/*0*/ function: () -> kotlin.Int): Run
public inline fun inlineFunWithInvoke(/*0*/ s: (p: kotlin.Int) -> kotlin.Unit, /*1*/ ext: kotlin.Int.(p: kotlin.Int) -> kotlin.Unit): kotlin.Unit
public inline fun inlineFunWithInvokeNonInline(/*0*/ noinline s: (p: kotlin.Int) -> kotlin.Unit, /*1*/ ext: kotlin.Int.(p: kotlin.Int) -> kotlin.Unit): kotlin.Unit
public inline fun ((kotlin.Int) -> kotlin.Unit).inlineExt(): kotlin.Unit
@@ -1,7 +1,5 @@
package
public /*synthesized*/ fun </*0*/ K : kotlin.Any!, /*1*/ V : kotlin.Any!> ConcMap(/*0*/ function: (key: K!, mappingFunction: MyFunc<in K!, out V!>!) -> V!): ConcMap<K, V>
public /*synthesized*/ fun </*0*/ K : kotlin.Any!, /*1*/ V : kotlin.Any!> MyFunc(/*0*/ function: (String: K!) -> V!): MyFunc<K, V>
public fun concurrentMap(): kotlin.Unit
public open class ConcHashMap</*0*/ K : kotlin.Any!, /*1*/ V : kotlin.Any!> : ConcMap<K!, V!> {
@@ -1,7 +1,5 @@
package
public /*synthesized*/ fun A(/*0*/ function: (r: java.lang.Runnable!) -> kotlin.Unit): A
public interface A {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract fun foo(/*0*/ r: java.lang.Runnable!): kotlin.Unit
@@ -1,7 +1,5 @@
package
public /*synthesized*/ fun Bar(/*0*/ function: (f: Foo<(raw) kotlin.CharSequence!>!) -> kotlin.Unit): Bar
public interface Bar {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract fun f(/*0*/ f: Foo<(raw) kotlin.CharSequence!>!): kotlin.Unit
@@ -1,7 +1,5 @@
package
public /*synthesized*/ fun </*0*/ K : kotlin.Any!> A(/*0*/ function: (key: K!, f: MyFunc!) -> K!): A<K>
public /*synthesized*/ fun MyFunc(/*0*/ function: (x: kotlin.String!) -> kotlin.String!): MyFunc
public fun main(): kotlin.Unit
public interface A</*0*/ K : kotlin.Any!> {
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun </*0*/ X : [ERROR : Cyclic upper bounds]> XYZ(/*0*/ function: () -> XYZ<(raw) [ERROR : Cyclic upper bounds]>!): XYZ<X>
public fun main(/*0*/ xyz: XYZ<*>): XYZ<(raw) [ERROR : Cyclic upper bounds]>!
public interface XYZ</*0*/ X : [ERROR : Cyclic upper bounds]> {
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun </*0*/ X : Y!, /*1*/ Y : [ERROR : Cyclic upper bounds], /*2*/ Z : [ERROR : Cyclic upper bounds]> XYZ(/*0*/ function: () -> XYZ<(raw) [ERROR : Cyclic upper bounds], (raw) [ERROR : Cyclic upper bounds], (raw) [ERROR : Cyclic upper bounds]>!): XYZ<X, Y, Z>
public fun main(/*0*/ xyz: XYZ<*, *, *>): XYZ<(raw) [ERROR : Cyclic upper bounds], (raw) [ERROR : Cyclic upper bounds], (raw) [ERROR : Cyclic upper bounds]>!
public interface XYZ</*0*/ X : Y!, /*1*/ Y : [ERROR : Cyclic upper bounds], /*2*/ Z : [ERROR : Cyclic upper bounds]> {
@@ -1,7 +1,5 @@
package
public /*synthesized*/ fun J(/*0*/ function: (x: kotlin.String?) -> kotlin.String): J
public /*synthesized*/ fun J2(/*0*/ function: (x: kotlin.String?) -> kotlin.String): J2
public fun main(): kotlin.Unit
public interface J {
@@ -15,7 +15,4 @@ public open class FormFieldValidatorPresenterTest</*0*/ V : kotlin.String!> {
public abstract fun onValidityChanged(/*0*/ valid: kotlin.Boolean): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
// Static members
public final /*synthesized*/ fun ValidationListenerTest(/*0*/ function: (valid: kotlin.Boolean) -> kotlin.Unit): FormFieldValidatorPresenterTest.ValidationListenerTest
}
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun </*0*/ T : kotlin.Any!, /*1*/ U : kotlin.Any!, /*2*/ R : kotlin.Any!> BiFunction(/*0*/ function: (t: T!, u: U!) -> R!): BiFunction<T, U, R>
public fun main(): kotlin.Unit
public open class A</*0*/ K : kotlin.Any!, /*1*/ V : kotlin.Any!> {
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun </*0*/ E : kotlin.Any!> EventListener(/*0*/ function: (x: kotlin.String!) -> E!): EventListener<E>
public fun main(): kotlin.Unit
public open class A {
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun </*0*/ E : kotlin.Any!> EventListener(/*0*/ function: (e: E!) -> kotlin.Unit): EventListener<E>
public fun main(): kotlin.Unit
public open class A {
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun </*0*/ E : kotlin.Any!> EventListener(/*0*/ function: (e: E!) -> kotlin.Unit): EventListener<E>
public fun main(): kotlin.Unit
public open class A {
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun </*0*/ E : kotlin.CharSequence!, /*1*/ F : kotlin.collections.(Mutable)Map<kotlin.String!, E!>!> Function(/*0*/ function: (f: F!) -> E!): Function<E, F>
public fun main(): kotlin.Unit
public open class A {
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun </*0*/ E : kotlin.collections.(Mutable)Map<kotlin.String!, kotlin.Int!>!, /*1*/ F : kotlin.CharSequence!> Function(/*0*/ function: (e: E!) -> F!): Function<E, F>
public fun main(): kotlin.Unit
public open class A {
@@ -1,7 +1,5 @@
package
public/*package*/ /*synthesized*/ fun J(/*0*/ function: () -> kotlin.collections.List<kotlin.String>): J
public/*package*/ interface J : K {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ fun foo(): kotlin.collections.List<kotlin.String>
@@ -1,7 +1,5 @@
package
public /*synthesized*/ fun J(/*0*/ function: () -> kotlin.String!): J
public interface J {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract fun foo(): kotlin.String!
@@ -1,9 +1,5 @@
package
public /*synthesized*/ fun J1(/*0*/ function: () -> In<kotlin.String!>!): J1
public /*synthesized*/ fun J2(/*0*/ function: () -> In<kotlin.String!>): J2
public /*synthesized*/ fun J3(/*0*/ function: () -> In<kotlin.String!>?): J3
public interface In</*0*/ in T> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
@@ -1,7 +1,5 @@
package
public /*synthesized*/ fun J(/*0*/ function: () -> kotlin.collections.(Mutable)List<kotlin.String!>!): J
public interface ILNS {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract fun foo(): kotlin.collections.List<kotlin.String?>
@@ -1,8 +1,5 @@
package
public /*synthesized*/ fun </*0*/ T : IBase!> JFooWithUpperBound(/*0*/ function: () -> T!): JFooWithUpperBound<T>
public /*synthesized*/ fun </*0*/ T : IBase!> JFooWithUpperBoundDerived(/*0*/ function: () -> T!): JFooWithUpperBoundDerived<T>
public interface IBase {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
@@ -99,8 +99,4 @@ public open class TestNN {
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
}
// Static members
public final /*synthesized*/ fun JNotNull(/*0*/ function: () -> kotlin.Any): TestNN.JNotNull
public final /*synthesized*/ fun JNull(/*0*/ function: () -> kotlin.Any?): TestNN.JNull
}
@@ -1,8 +1,5 @@
package
public/*package*/ /*synthesized*/ fun Sub(/*0*/ function: (superName: kotlin.Long) -> kotlin.Unit): Sub
public/*package*/ /*synthesized*/ fun Super(/*0*/ function: (superName: kotlin.Long) -> kotlin.Unit): Super
public/*package*/ interface Sub : Super {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ /*fake_override*/ fun foo(/*0*/ superName: kotlin.Long): kotlin.Unit
@@ -1,7 +1,5 @@
package
public/*package*/ /*synthesized*/ fun Sub(/*0*/ function: (superName: kotlin.Int) -> kotlin.Unit): Sub
public/*package*/ interface Sub : Super {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract override /*1*/ /*fake_override*/ fun foo(/*0*/ superName: kotlin.Int): kotlin.Unit
@@ -1,11 +1,5 @@
package
public/*package*/ /*synthesized*/ fun JSuper1(/*0*/ function: (jsuper1Name: kotlin.Int) -> kotlin.Unit): JSuper1
public/*package*/ /*synthesized*/ fun JSuper2(/*0*/ function: (jsuper2Name: kotlin.Int) -> kotlin.Unit): JSuper2
public/*package*/ /*synthesized*/ fun Sub1(/*0*/ function: (ksuperName: kotlin.Int) -> kotlin.Unit): Sub1
public/*package*/ /*synthesized*/ fun Sub2(/*0*/ function: (ksuperName: kotlin.Int) -> kotlin.Unit): Sub2
public/*package*/ /*synthesized*/ fun Sub3(/*0*/ function: (ksuperName: kotlin.Int) -> kotlin.Unit): Sub3
public/*package*/ interface JSuper1 {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract fun foo(/*0*/ jsuper1Name: kotlin.Int): kotlin.Unit
@@ -1,7 +1,5 @@
package
public/*package*/ /*synthesized*/ fun JavaInterface(/*0*/ function: (javaName: kotlin.Int) -> kotlin.Unit): JavaInterface
public final class BothTraitsSubclass : JavaInterface, KotlinTrait {
public constructor BothTraitsSubclass()
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@@ -1,7 +1,5 @@
package
public /*synthesized*/ fun JavaInterface(/*0*/ function: (javaName: kotlin.Int) -> kotlin.Unit): JavaInterface
public interface JavaInterface {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract fun foo(/*0*/ javaName: kotlin.Int): kotlin.Unit
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun </*0*/ T : kotlin.Any!> A(/*0*/ function: (y: T?) -> kotlin.Boolean): A<T>
public fun test(): kotlin.Unit
public interface A</*0*/ T : kotlin.Any!> {
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun </*0*/ T : kotlin.Any!> A(/*0*/ function: (x: T) -> kotlin.Unit): A<T>
public fun test(): kotlin.Unit
public interface A</*0*/ T : kotlin.Any!> {
@@ -19,5 +19,4 @@ public open class J {
public final var staticJ: J.Invoke!
@org.jetbrains.annotations.Nullable public final var staticN: J.Invoke?
@org.jetbrains.annotations.NotNull public final var staticNN: J.Invoke
public final /*synthesized*/ fun Invoke(/*0*/ function: () -> kotlin.Unit): J.Invoke
}
@@ -1,7 +1,5 @@
package
public /*synthesized*/ fun B(/*0*/ function: (x: kotlin.Any!, y: kotlin.collections.(Mutable)List<(raw) kotlin.Any?>!) -> kotlin.String!): B
public interface A</*0*/ T : kotlin.Any!> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract fun </*0*/ E : kotlin.CharSequence!> foo(/*0*/ x: T!, /*1*/ y: (kotlin.collections.MutableList<out T!>..kotlin.collections.List<T!>?)): E!
@@ -1,9 +1,5 @@
package
public /*synthesized*/ fun </*0*/ T : kotlin.Any!> A(/*0*/ function: (x: T!, y: Fun<out T!>!) -> kotlin.Unit): A<T>
public /*synthesized*/ fun B(/*0*/ function: (x: kotlin.Any!, y: Fun<(raw) kotlin.Any!>!) -> kotlin.Unit): B
public /*synthesized*/ fun </*0*/ T : kotlin.Any!> Fun(/*0*/ function: (x: T!) -> kotlin.Unit): Fun<T>
public interface A</*0*/ T : kotlin.Any!> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract fun foo(/*0*/ x: T!, /*1*/ y: Fun<out T!>!): kotlin.Unit
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun </*0*/ T : kotlin.Any!> A(/*0*/ function: (t: T!) -> kotlin.Boolean): A<T>
public fun main(): kotlin.Unit
public interface A</*0*/ T : kotlin.Any!> {
@@ -1,10 +1,5 @@
package
public /*synthesized*/ fun </*0*/ T : kotlin.Any!> A(/*0*/ function: (x: T, y: T?) -> kotlin.Unit): A<T>
public /*synthesized*/ fun B1(/*0*/ function: (x: kotlin.String, y: kotlin.String?) -> kotlin.Unit): B1
public /*synthesized*/ fun B2(/*0*/ function: (x: kotlin.String, y: kotlin.String?) -> kotlin.Unit): B2
public /*synthesized*/ fun B3(/*0*/ function: (x: kotlin.String!, y: kotlin.String!) -> kotlin.Unit): B3
public interface A</*0*/ T : kotlin.Any!> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract fun foo(/*0*/ @org.jetbrains.annotations.NotNull x: T, /*1*/ @org.jetbrains.annotations.Nullable y: T?): kotlin.Unit
@@ -1,8 +1,5 @@
package
public /*synthesized*/ fun A(/*0*/ function: (x: kotlin.String?) -> kotlin.Unit): A
public /*synthesized*/ fun B(/*0*/ function: (x: kotlin.String) -> kotlin.Unit): B
public interface A {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract fun foo(/*0*/ @org.jetbrains.annotations.Nullable x: kotlin.String?): kotlin.Unit
@@ -1,8 +1,5 @@
package
public /*synthesized*/ fun A(/*0*/ function: () -> kotlin.String?): A
public /*synthesized*/ fun B(/*0*/ function: () -> kotlin.String): B
public interface A {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@org.jetbrains.annotations.Nullable public abstract fun foo(): kotlin.String?
@@ -5,7 +5,6 @@ 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
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun A(/*0*/ function: () -> kotlin.String!): A
public fun foo(/*0*/ x: kotlin.Any?): kotlin.Unit
public interface A {
@@ -1,7 +1,5 @@
package
public /*synthesized*/ fun My(/*0*/ function: (arg: kotlin.String!) -> kotlin.String!): My
public interface My {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public abstract fun foo(/*0*/ arg: kotlin.String!): kotlin.String!
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun J(/*0*/ function: () -> kotlin.Unit): J
public fun f1(/*0*/ x: I10): kotlin.Unit
public fun f2(/*0*/ x: I11): [ERROR : Error function type]
public fun f3(/*0*/ x: J): kotlin.Unit
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun A(/*0*/ function: () -> kotlin.Int): A
public fun foo(/*0*/ c: C): kotlin.Unit
public interface A {
@@ -1,7 +1,5 @@
package
public /*synthesized*/ fun JavaInterface1(/*0*/ function: () -> kotlin.String!): JavaInterface1
public /*synthesized*/ fun JavaInterface2(/*0*/ function: (value: kotlin.Int) -> kotlin.Unit): JavaInterface2
public fun foo(/*0*/ k: KotlinClass): kotlin.Unit
public fun useString(/*0*/ i: kotlin.String): kotlin.Unit
@@ -1,7 +1,5 @@
package
public /*synthesized*/ fun JavaInterface1(/*0*/ function: () -> kotlin.String!): JavaInterface1
public /*synthesized*/ fun JavaInterface2(/*0*/ function: (value: kotlin.String!) -> kotlin.Unit): JavaInterface2
public fun foo(/*0*/ k: KotlinClass): kotlin.Unit
public fun useString(/*0*/ i: kotlin.String): kotlin.Unit
@@ -1,7 +1,5 @@
package
public /*synthesized*/ fun JavaInterface1(/*0*/ function: () -> kotlin.String!): JavaInterface1
public /*synthesized*/ fun JavaInterface2(/*0*/ function: (value: kotlin.String!) -> kotlin.Unit): JavaInterface2
public fun foo(/*0*/ k: KotlinClass): kotlin.Unit
public fun useString(/*0*/ i: kotlin.String): kotlin.Unit
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun JavaInterface1(/*0*/ function: () -> kotlin.String!): JavaInterface1
public fun foo(/*0*/ k: KotlinClass): kotlin.Unit
public fun useString(/*0*/ i: kotlin.String): kotlin.Unit
@@ -1,7 +1,5 @@
package
public /*synthesized*/ fun JavaInterface(/*0*/ function: () -> kotlin.Int): JavaInterface
public /*synthesized*/ fun JavaInterface2(/*0*/ function: () -> kotlin.Int): JavaInterface2
public fun foo(/*0*/ o: JavaInterface2): kotlin.Int
public abstract class BaseClass : JavaInterface {
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun JavaInterface(/*0*/ function: () -> kotlin.Int): JavaInterface
public fun kotlin.Any.foo(): kotlin.Int
public abstract class BaseClass : JavaInterface {
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun A(/*0*/ function: () -> kotlin.Int): A
public fun </*0*/ T : B> foo(/*0*/ t: T): kotlin.Unit
public interface A {
@@ -15,7 +15,4 @@ public open class JavaClass</*0*/ T : kotlin.Any!> {
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
// Static members
public final /*synthesized*/ fun </*0*/ X : kotlin.Any!> Inner(/*0*/ function: (t: T!, x: X!, runnable: java.lang.Runnable!) -> T!): JavaClass.Inner<X>
}
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun JavaInterface(/*0*/ function: (s: kotlin.String, runnable: java.lang.Runnable) -> kotlin.Unit): JavaInterface
public fun foo(/*0*/ javaInterface: JavaInterface): kotlin.Unit
public interface JavaInterface {
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun JavaInterface(/*0*/ function: (s: kotlin.String!, runnable1: java.lang.Runnable!, runnable2: java.lang.Runnable!) -> kotlin.Unit): JavaInterface
public fun foo(/*0*/ javaInterface: JavaInterface): kotlin.Unit
public interface JavaInterface {
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun </*0*/ T : kotlin.Any!> Provider(/*0*/ function: () -> T!): Provider<T>
public fun foo(/*0*/ javaInterface: JavaInterface): kotlin.Unit
public interface JavaInterface {
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun J(/*0*/ function: (kotlin.Int!) -> java.lang.Void!): J
public fun jj(): kotlin.Unit
public fun useJ(/*0*/ j: J): kotlin.Unit
@@ -18,7 +18,4 @@ public/*package*/ open class Foo {
public abstract operator fun invoke(/*0*/ i: T!): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
// Static members
public/*package*/ final /*synthesized*/ fun </*0*/ T : kotlin.Any!> FObject(/*0*/ function: (i: T!) -> kotlin.Unit): Foo.FObject<T>
}
@@ -18,7 +18,4 @@ public/*package*/ open class Foo {
public abstract operator fun invoke(/*0*/ i: T!): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
// Static members
public/*package*/ final /*synthesized*/ fun </*0*/ T : kotlin.Any!> FObject(/*0*/ function: (i: T!) -> kotlin.Unit): Foo.FObject<T>
}
@@ -16,7 +16,4 @@ public open class Foo {
public abstract operator fun invoke(/*0*/ i: kotlin.Any!): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
// Static members
public/*package*/ final /*synthesized*/ fun FObject(/*0*/ function: (i: kotlin.Any!) -> kotlin.Unit): Foo.FObject
}
@@ -16,7 +16,4 @@ public open class Foo {
public abstract operator fun invoke(/*0*/ i: kotlin.Any!): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
// Static members
public/*package*/ final /*synthesized*/ fun FObject(/*0*/ function: (i: kotlin.Any!) -> kotlin.Unit): Foo.FObject
}
@@ -32,11 +32,6 @@ public open class JHost {
public abstract fun run(): kotlin.Unit
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
// Static members
public final /*synthesized*/ fun </*0*/ T : kotlin.Any!> Consumer(/*0*/ function: (x: T!) -> kotlin.Unit): JHost.Consumer<T>
public final /*synthesized*/ fun </*0*/ T1 : kotlin.Any!, /*1*/ T2 : kotlin.Any!> Consumer2(/*0*/ function: (x1: T1!, x2: T2!) -> kotlin.Unit): JHost.Consumer2<T1, T2>
public final /*synthesized*/ fun Runnable(/*0*/ function: () -> kotlin.Unit): JHost.Runnable
}
public typealias C</*0*/ T> = JHost.Consumer<T>
public typealias C2</*0*/ T> = JHost.Consumer2<T, T>
@@ -1,7 +1,5 @@
package test
public /*synthesized*/ fun </*0*/ T : kotlin.Any!> Comparator(/*0*/ function: (T!, T!) -> kotlin.Int): test.Comparator<T>
public interface Comparator</*0*/ T : kotlin.Any!> {
public abstract fun compare(/*0*/ p0: T!, /*1*/ p1: T!): kotlin.Int
}
@@ -1,7 +1,5 @@
package test
public /*synthesized*/ fun FilenameFilter(/*0*/ function: (java.io.File!, kotlin.String!) -> kotlin.Boolean): test.FilenameFilter
public interface FilenameFilter {
public abstract fun accept(/*0*/ p0: java.io.File!, /*1*/ p1: kotlin.String!): kotlin.Boolean
}
@@ -1,7 +1,5 @@
package test
public /*synthesized*/ fun </*0*/ T : test.GenericInterfaceParameterWithSelfBound<T!>!> GenericInterfaceParameterWithSelfBound(/*0*/ function: (T!) -> T!): test.GenericInterfaceParameterWithSelfBound<T>
public interface GenericInterfaceParameterWithSelfBound</*0*/ T : test.GenericInterfaceParameterWithSelfBound<T!>!> {
public abstract fun method(/*0*/ p0: T!): T!
}
@@ -1,7 +1,5 @@
package test
public /*synthesized*/ fun </*0*/ A : kotlin.Comparable<A!>!, /*1*/ B : kotlin.collections.(Mutable)List<A!>!> GenericInterfaceParametersWithBounds(/*0*/ function: (kotlin.Array<(out) A!>!, B!) -> kotlin.Unit): test.GenericInterfaceParametersWithBounds<A, B> where A : kotlin.Cloneable!
public interface GenericInterfaceParametersWithBounds</*0*/ A : kotlin.Comparable<A!>!, /*1*/ B : kotlin.collections.(Mutable)List<A!>!> where A : kotlin.Cloneable! {
public abstract fun method(/*0*/ p0: kotlin.Array<(out) A!>!, /*1*/ p1: B!): kotlin.Unit
}
@@ -15,15 +15,9 @@ public interface Nested {
public interface Runnable {
public abstract fun run(): kotlin.Unit
}
// Static members
public final /*synthesized*/ fun Runnable(/*0*/ function: () -> kotlin.Unit): test.Nested.Deeper2.Runnable
}
public interface Runnable {
public abstract fun run(): kotlin.Unit
}
// Static members
public final /*synthesized*/ fun Runnable(/*0*/ function: () -> kotlin.Unit): test.Nested.Runnable
}
@@ -1,7 +1,5 @@
package test
public /*synthesized*/ fun Runnable(/*0*/ function: () -> kotlin.Unit): test.Runnable
public interface Runnable {
public abstract fun run(): kotlin.Unit
}
@@ -13,9 +13,4 @@ public interface SamSubinterfaceOfTwo {
public interface Super2</*0*/ T : kotlin.Any!> {
public abstract fun f(): T!
}
// Static members
public final /*synthesized*/ fun Sub(/*0*/ function: () -> kotlin.String!): test.SamSubinterfaceOfTwo.Sub
public final /*synthesized*/ fun Super1(/*0*/ function: () -> kotlin.CharSequence!): test.SamSubinterfaceOfTwo.Super1
public final /*synthesized*/ fun </*0*/ T : kotlin.Any!> Super2(/*0*/ function: () -> T!): test.SamSubinterfaceOfTwo.Super2<T>
}
@@ -1,7 +1,5 @@
package test
public /*synthesized*/ fun SamSubinterfaceOverridding(/*0*/ function: () -> kotlin.Unit): test.SamSubinterfaceOverridding
public interface SamSubinterfaceOverridding : java.lang.Runnable {
public abstract override /*1*/ fun run(): kotlin.Unit
}
@@ -1,7 +1,5 @@
package test
public /*synthesized*/ fun SubstitutedSamInterface(/*0*/ function: (kotlin.String!, kotlin.String!) -> kotlin.Int): test.SubstitutedSamInterface
public interface SubstitutedSamInterface : java.util.Comparator<kotlin.String!> {
public abstract override /*1*/ /*fake_override*/ fun compare(/*0*/ p0: kotlin.String!, /*1*/ p1: kotlin.String!): kotlin.Int
}
@@ -1,7 +1,5 @@
package test
public /*synthesized*/ fun SubstitutedSamInterfaceSubclassOfBuiltin(/*0*/ function: (other: test.SubstitutedSamInterfaceSubclassOfBuiltin!) -> kotlin.Int): test.SubstitutedSamInterfaceSubclassOfBuiltin
public interface SubstitutedSamInterfaceSubclassOfBuiltin : kotlin.Comparable<test.SubstitutedSamInterfaceSubclassOfBuiltin!> {
public abstract override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: test.SubstitutedSamInterfaceSubclassOfBuiltin!): kotlin.Int
}
@@ -1,7 +1,5 @@
package test
public /*synthesized*/ fun VarargParameter(/*0*/ function: (kotlin.Array<(out) kotlin.String!>!) -> kotlin.Unit): test.VarargParameter
public interface VarargParameter {
public abstract fun f(/*0*/ vararg p0: kotlin.String! /*kotlin.Array<(out) kotlin.String!>!*/): kotlin.Unit
}
@@ -9,8 +9,4 @@ public interface DeepSamLoop {
public interface Foo {
public abstract fun foo(/*0*/ p0: test.DeepSamLoop.Bar!): kotlin.Unit
}
// Static members
public final /*synthesized*/ fun Bar(/*0*/ function: (test.DeepSamLoop.Foo!) -> kotlin.Unit): test.DeepSamLoop.Bar
public final /*synthesized*/ fun Foo(/*0*/ function: (test.DeepSamLoop.Bar!) -> kotlin.Unit): test.DeepSamLoop.Foo
}
@@ -7,7 +7,4 @@ public open class PrivateSamAdapter {
private interface SamInterface {
public abstract fun foo(): kotlin.Unit
}
// Static members
private final /*synthesized*/ fun SamInterface(/*0*/ function: () -> kotlin.Unit): test.PrivateSamAdapter.SamInterface
}
@@ -1,7 +1,5 @@
package test
public /*synthesized*/ fun SelfAsParameter(/*0*/ function: (test.SelfAsParameter!) -> kotlin.Unit): test.SelfAsParameter
public interface SelfAsParameter {
public abstract fun foo(/*0*/ p0: test.SelfAsParameter!): kotlin.Unit
}
@@ -10,7 +10,4 @@ public interface AdapterDoesntOverrideDeclaration {
public interface Super {
public abstract fun foo(/*0*/ p0: (() -> kotlin.Unit!)!): kotlin.Unit
}
// Static members
public final /*synthesized*/ fun Super(/*0*/ function: ((() -> kotlin.Unit!)!) -> kotlin.Unit): test.AdapterDoesntOverrideDeclaration.Super
}
@@ -13,9 +13,4 @@ public interface InheritedSameAdapters {
public interface Super2 {
public abstract fun foo(/*0*/ p0: java.lang.Runnable!): kotlin.Unit
}
// Static members
public final /*synthesized*/ fun Sub(/*0*/ function: (java.lang.Runnable!) -> kotlin.Unit): test.InheritedSameAdapters.Sub
public final /*synthesized*/ fun Super1(/*0*/ function: (java.lang.Runnable!) -> kotlin.Unit): test.InheritedSameAdapters.Super1
public final /*synthesized*/ fun Super2(/*0*/ function: (java.lang.Runnable!) -> kotlin.Unit): test.InheritedSameAdapters.Super2
}
@@ -17,10 +17,4 @@ public interface InheritedSameAdaptersWithSubstitution {
public interface Super2Substituted : test.InheritedSameAdaptersWithSubstitution.Super2<kotlin.String!> {
public abstract override /*1*/ /*fake_override*/ fun foo(/*0*/ p0: java.util.Comparator<kotlin.String!>!): kotlin.Unit
}
// Static members
public final /*synthesized*/ fun Sub(/*0*/ function: (java.util.Comparator<kotlin.String!>!) -> kotlin.Unit): test.InheritedSameAdaptersWithSubstitution.Sub
public final /*synthesized*/ fun Super1(/*0*/ function: (java.util.Comparator<kotlin.String!>!) -> kotlin.Unit): test.InheritedSameAdaptersWithSubstitution.Super1
public final /*synthesized*/ fun </*0*/ T : kotlin.Any!> Super2(/*0*/ function: (java.util.Comparator<T!>!) -> kotlin.Unit): test.InheritedSameAdaptersWithSubstitution.Super2<T>
public final /*synthesized*/ fun Super2Substituted(/*0*/ function: (java.util.Comparator<kotlin.String!>!) -> kotlin.Unit): test.InheritedSameAdaptersWithSubstitution.Super2Substituted
}
@@ -9,8 +9,4 @@ public interface InheritedSimple {
public interface Super {
public abstract fun foo(/*0*/ p0: java.lang.Runnable!): kotlin.Unit
}
// Static members
public final /*synthesized*/ fun Sub(/*0*/ function: (java.lang.Runnable!) -> kotlin.Unit): test.InheritedSimple.Sub
public final /*synthesized*/ fun Super(/*0*/ function: (java.lang.Runnable!) -> kotlin.Unit): test.InheritedSimple.Super
}
@@ -1,6 +1,5 @@
package test
public /*synthesized*/ fun SamInterface(/*0*/ function: () -> kotlin.Unit): test.SamInterface
public fun topLevelFunction(): kotlin.Unit
public open class JavaClass {
@@ -1,7 +1,5 @@
package test
public /*synthesized*/ fun A(/*0*/ function: (kotlin.Int) -> kotlin.Unit): test.A
public interface A {
public abstract fun foo(/*0*/ p0: kotlin.Int): kotlin.Unit
}
@@ -1,7 +1,5 @@
package test
public /*synthesized*/ fun J(/*0*/ function: (test.K!) -> kotlin.Unit): test.J
public interface J {
public abstract fun foo(/*0*/ p0: test.K!): kotlin.Unit
}
@@ -1,7 +1,5 @@
package test
public /*synthesized*/ fun NullInAnnotation(/*0*/ function: () -> kotlin.Unit): test.NullInAnnotation
public interface NullInAnnotation {
@test.NullInAnnotation.Ann(a = null, b = {null}) public abstract fun foo(): kotlin.Unit
@@ -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.
@@ -22,7 +22,6 @@ import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.descriptors.SimpleFunctionDescriptor
import org.jetbrains.kotlin.incremental.components.LookupLocation
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
import org.jetbrains.kotlin.load.java.descriptors.SamConstructorDescriptorKindExclude
import org.jetbrains.kotlin.load.java.lazy.LazyJavaResolverContext
import org.jetbrains.kotlin.load.java.structure.JavaClass
import org.jetbrains.kotlin.load.java.structure.JavaPackage
@@ -32,7 +31,6 @@ import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader
import org.jetbrains.kotlin.name.ClassId
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.name.SpecialNames
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter
import org.jetbrains.kotlin.storage.NullableLazyValue
import org.jetbrains.kotlin.utils.alwaysTrue
@@ -153,17 +151,10 @@ class LazyJavaPackageScope(
}
override fun computeFunctionNames(kindFilter: DescriptorKindFilter, nameFilter: ((Name) -> Boolean)?): Set<Name> {
// optimization: only SAM-constructors may exist in java package
if (kindFilter.excludes.contains(SamConstructorDescriptorKindExclude)) return emptySet()
// For SAM-constructors
return computeClassNames(DescriptorKindFilter.CLASSIFIERS, nameFilter)
return emptySet()
}
override fun computeNonDeclaredFunctions(result: MutableCollection<SimpleFunctionDescriptor>, name: Name) {
c.components.samConversionResolver.resolveSamConstructor(ownerDescriptor) {
getContributedClassifier(name, NoLookupLocation.FOR_ALREADY_TRACKED)
}?.let { result.add(it) }
}
override fun computePropertyNames(kindFilter: DescriptorKindFilter, nameFilter: ((Name) -> Boolean)?) = emptySet<Name>()
@@ -64,10 +64,6 @@ class LazyJavaStaticClassScope(
}
override fun computeNonDeclaredFunctions(result: MutableCollection<SimpleFunctionDescriptor>, name: Name) {
c.components.samConversionResolver.resolveSamConstructor(ownerDescriptor) {
ownerDescriptor.unsubstitutedInnerClassesScope.getContributedClassifier(name, NoLookupLocation.FOR_ALREADY_TRACKED)
}?.let { result.add(it) }
val functionsFromSupertypes = getStaticFunctionsFromJavaSuperClasses(name, ownerDescriptor)
result.addAll(resolveOverridesForStaticMembers(name, functionsFromSupertypes, result, ownerDescriptor, c.components.errorReporter))
@@ -1,6 +1,5 @@
package
@SamWithReceiver public /*synthesized*/ fun Sam(/*0*/ function: () -> kotlin.Unit): Sam
public fun test(): kotlin.Unit
@SamWithReceiver public interface Sam {
@@ -1,6 +1,5 @@
package
@SamWithReceiver public /*synthesized*/ fun Sam(/*0*/ function: kotlin.String!.(b: kotlin.String!) -> kotlin.Unit): Sam
public fun test(): kotlin.Unit
@SamWithReceiver public interface Sam {
@@ -1,6 +1,5 @@
package
@SamWithReceiver public /*synthesized*/ fun Sam(/*0*/ function: () -> kotlin.Unit): Sam
public fun test(): kotlin.Unit
public open class Exec {
@@ -1,6 +1,5 @@
package
@SamWithReceiver public /*synthesized*/ fun Sam(/*0*/ function: kotlin.String!.() -> kotlin.Unit): Sam
public fun test(): kotlin.Unit
public open class Exec {
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun Sam(/*0*/ function: (a: kotlin.String!) -> kotlin.Unit): Sam
public fun test(): kotlin.Unit
public open class Exec {
@@ -1,6 +1,5 @@
package
@SamWithReceiver public /*synthesized*/ fun Sam(/*0*/ function: kotlin.String!.(b: kotlin.String!) -> kotlin.String!): Sam
public fun test(): kotlin.Unit
@SamWithReceiver public interface Sam {
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun Sam(/*0*/ function: (a: kotlin.String!, b: kotlin.String!) -> kotlin.String!): Sam
public fun test(): kotlin.Unit
public interface Sam {
@@ -1,6 +1,5 @@
package
@SamWithReceiver public /*synthesized*/ fun Sam(/*0*/ function: kotlin.String!.() -> kotlin.Unit): Sam
public fun test(): kotlin.Unit
@SamWithReceiver public interface Sam {
@@ -1,6 +1,5 @@
package
public /*synthesized*/ fun Sam(/*0*/ function: (a: kotlin.String!) -> kotlin.Unit): Sam
public fun test(): kotlin.Unit
public interface Sam {
@@ -1,7 +1,5 @@
package
@SamWithReceiver1 public /*synthesized*/ fun Sam(/*0*/ function: (a: kotlin.String!) -> kotlin.Unit): Sam
public open class Exec {
public constructor Exec()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean