Introduce Function, KFunction interfaces and 'extension' annotation
This commit is contained in:
@@ -1522,6 +1522,10 @@ public final annotation class deprecated : kotlin.Annotation {
|
||||
internal final fun <get-value>(): kotlin.String
|
||||
}
|
||||
|
||||
public final annotation class extension : kotlin.Annotation {
|
||||
/*primary*/ public constructor extension()
|
||||
}
|
||||
|
||||
public final annotation class inline : kotlin.Annotation {
|
||||
/*primary*/ public constructor inline(/*0*/ strategy: kotlin.InlineStrategy = ...)
|
||||
public final val strategy: kotlin.InlineStrategy
|
||||
|
||||
@@ -30,6 +30,11 @@ public annotation class data
|
||||
*/
|
||||
public annotation class deprecated(val value: String)
|
||||
|
||||
/**
|
||||
* Signifies that the annotated functional type represents an extension function.
|
||||
*/
|
||||
public annotation class extension
|
||||
|
||||
/**
|
||||
* Suppresses the given compilation warnings in the annotated element.
|
||||
* @property names names of the compiler diagnostics to suppress.
|
||||
|
||||
@@ -19,117 +19,117 @@
|
||||
package kotlin
|
||||
|
||||
/** An extension function that takes 0 arguments. */
|
||||
public interface ExtensionFunction0<in T, out R> {
|
||||
public interface ExtensionFunction0<in T, out R> : Function<R> {
|
||||
/** Invokes the function. */
|
||||
public fun T.invoke(): R
|
||||
}
|
||||
/** An extension function that takes 1 argument. */
|
||||
public interface ExtensionFunction1<in T, in P1, out R> {
|
||||
public interface ExtensionFunction1<in T, in P1, out R> : Function<R> {
|
||||
/** Invokes the function with the specified argument. */
|
||||
public fun T.invoke(p1: P1): R
|
||||
}
|
||||
/** An extension function that takes 2 arguments. */
|
||||
public interface ExtensionFunction2<in T, in P1, in P2, out R> {
|
||||
public interface ExtensionFunction2<in T, in P1, in P2, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun T.invoke(p1: P1, p2: P2): R
|
||||
}
|
||||
/** An extension function that takes 3 arguments. */
|
||||
public interface ExtensionFunction3<in T, in P1, in P2, in P3, out R> {
|
||||
public interface ExtensionFunction3<in T, in P1, in P2, in P3, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3): R
|
||||
}
|
||||
/** An extension function that takes 4 arguments. */
|
||||
public interface ExtensionFunction4<in T, in P1, in P2, in P3, in P4, out R> {
|
||||
public interface ExtensionFunction4<in T, in P1, in P2, in P3, in P4, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4): R
|
||||
}
|
||||
/** An extension function that takes 5 arguments. */
|
||||
public interface ExtensionFunction5<in T, in P1, in P2, in P3, in P4, in P5, out R> {
|
||||
public interface ExtensionFunction5<in T, in P1, in P2, in P3, in P4, in P5, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5): R
|
||||
}
|
||||
/** An extension function that takes 6 arguments. */
|
||||
public interface ExtensionFunction6<in T, in P1, in P2, in P3, in P4, in P5, in P6, out R> {
|
||||
public interface ExtensionFunction6<in T, in P1, in P2, in P3, in P4, in P5, in P6, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6): R
|
||||
}
|
||||
/** An extension function that takes 7 arguments. */
|
||||
public interface ExtensionFunction7<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, out R> {
|
||||
public interface ExtensionFunction7<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7): R
|
||||
}
|
||||
/** An extension function that takes 8 arguments. */
|
||||
public interface ExtensionFunction8<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, out R> {
|
||||
public interface ExtensionFunction8<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8): R
|
||||
}
|
||||
/** An extension function that takes 9 arguments. */
|
||||
public interface ExtensionFunction9<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, out R> {
|
||||
public interface ExtensionFunction9<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9): R
|
||||
}
|
||||
/** An extension function that takes 10 arguments. */
|
||||
public interface ExtensionFunction10<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, out R> {
|
||||
public interface ExtensionFunction10<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10): R
|
||||
}
|
||||
/** An extension function that takes 11 arguments. */
|
||||
public interface ExtensionFunction11<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, out R> {
|
||||
public interface ExtensionFunction11<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11): R
|
||||
}
|
||||
/** An extension function that takes 12 arguments. */
|
||||
public interface ExtensionFunction12<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, out R> {
|
||||
public interface ExtensionFunction12<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12): R
|
||||
}
|
||||
/** An extension function that takes 13 arguments. */
|
||||
public interface ExtensionFunction13<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, out R> {
|
||||
public interface ExtensionFunction13<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13): R
|
||||
}
|
||||
/** An extension function that takes 14 arguments. */
|
||||
public interface ExtensionFunction14<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, out R> {
|
||||
public interface ExtensionFunction14<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14): R
|
||||
}
|
||||
/** An extension function that takes 15 arguments. */
|
||||
public interface ExtensionFunction15<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, out R> {
|
||||
public interface ExtensionFunction15<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15): R
|
||||
}
|
||||
/** An extension function that takes 16 arguments. */
|
||||
public interface ExtensionFunction16<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, out R> {
|
||||
public interface ExtensionFunction16<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16): R
|
||||
}
|
||||
/** An extension function that takes 17 arguments. */
|
||||
public interface ExtensionFunction17<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, out R> {
|
||||
public interface ExtensionFunction17<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17): R
|
||||
}
|
||||
/** An extension function that takes 18 arguments. */
|
||||
public interface ExtensionFunction18<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, out R> {
|
||||
public interface ExtensionFunction18<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18): R
|
||||
}
|
||||
/** An extension function that takes 19 arguments. */
|
||||
public interface ExtensionFunction19<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, out R> {
|
||||
public interface ExtensionFunction19<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19): R
|
||||
}
|
||||
/** An extension function that takes 20 arguments. */
|
||||
public interface ExtensionFunction20<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, out R> {
|
||||
public interface ExtensionFunction20<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19, p20: P20): R
|
||||
}
|
||||
/** An extension function that takes 21 arguments. */
|
||||
public interface ExtensionFunction21<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, in P21, out R> {
|
||||
public interface ExtensionFunction21<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, in P21, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19, p20: P20, p21: P21): R
|
||||
}
|
||||
/** An extension function that takes 22 arguments. */
|
||||
public interface ExtensionFunction22<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, in P21, in P22, out R> {
|
||||
public interface ExtensionFunction22<in T, in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, in P21, in P22, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19, p20: P20, p21: P21, p22: P22): R
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* 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 kotlin
|
||||
|
||||
/**
|
||||
* Represents a value of a functional type, such as a lambda, a function expression or a function reference.
|
||||
*/
|
||||
public interface Function<out R>
|
||||
@@ -19,117 +19,117 @@
|
||||
package kotlin
|
||||
|
||||
/** A function that takes 0 arguments. */
|
||||
public interface Function0<out R> {
|
||||
public interface Function0<out R> : Function<R> {
|
||||
/** Invokes the function. */
|
||||
public fun invoke(): R
|
||||
}
|
||||
/** A function that takes 1 argument. */
|
||||
public interface Function1<in P1, out R> {
|
||||
public interface Function1<in P1, out R> : Function<R> {
|
||||
/** Invokes the function with the specified argument. */
|
||||
public fun invoke(p1: P1): R
|
||||
}
|
||||
/** A function that takes 2 arguments. */
|
||||
public interface Function2<in P1, in P2, out R> {
|
||||
public interface Function2<in P1, in P2, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun invoke(p1: P1, p2: P2): R
|
||||
}
|
||||
/** A function that takes 3 arguments. */
|
||||
public interface Function3<in P1, in P2, in P3, out R> {
|
||||
public interface Function3<in P1, in P2, in P3, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3): R
|
||||
}
|
||||
/** A function that takes 4 arguments. */
|
||||
public interface Function4<in P1, in P2, in P3, in P4, out R> {
|
||||
public interface Function4<in P1, in P2, in P3, in P4, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4): R
|
||||
}
|
||||
/** A function that takes 5 arguments. */
|
||||
public interface Function5<in P1, in P2, in P3, in P4, in P5, out R> {
|
||||
public interface Function5<in P1, in P2, in P3, in P4, in P5, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5): R
|
||||
}
|
||||
/** A function that takes 6 arguments. */
|
||||
public interface Function6<in P1, in P2, in P3, in P4, in P5, in P6, out R> {
|
||||
public interface Function6<in P1, in P2, in P3, in P4, in P5, in P6, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6): R
|
||||
}
|
||||
/** A function that takes 7 arguments. */
|
||||
public interface Function7<in P1, in P2, in P3, in P4, in P5, in P6, in P7, out R> {
|
||||
public interface Function7<in P1, in P2, in P3, in P4, in P5, in P6, in P7, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7): R
|
||||
}
|
||||
/** A function that takes 8 arguments. */
|
||||
public interface Function8<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, out R> {
|
||||
public interface Function8<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8): R
|
||||
}
|
||||
/** A function that takes 9 arguments. */
|
||||
public interface Function9<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, out R> {
|
||||
public interface Function9<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9): R
|
||||
}
|
||||
/** A function that takes 10 arguments. */
|
||||
public interface Function10<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, out R> {
|
||||
public interface Function10<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10): R
|
||||
}
|
||||
/** A function that takes 11 arguments. */
|
||||
public interface Function11<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, out R> {
|
||||
public interface Function11<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11): R
|
||||
}
|
||||
/** A function that takes 12 arguments. */
|
||||
public interface Function12<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, out R> {
|
||||
public interface Function12<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12): R
|
||||
}
|
||||
/** A function that takes 13 arguments. */
|
||||
public interface Function13<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, out R> {
|
||||
public interface Function13<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13): R
|
||||
}
|
||||
/** A function that takes 14 arguments. */
|
||||
public interface Function14<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, out R> {
|
||||
public interface Function14<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14): R
|
||||
}
|
||||
/** A function that takes 15 arguments. */
|
||||
public interface Function15<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, out R> {
|
||||
public interface Function15<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15): R
|
||||
}
|
||||
/** A function that takes 16 arguments. */
|
||||
public interface Function16<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, out R> {
|
||||
public interface Function16<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16): R
|
||||
}
|
||||
/** A function that takes 17 arguments. */
|
||||
public interface Function17<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, out R> {
|
||||
public interface Function17<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17): R
|
||||
}
|
||||
/** A function that takes 18 arguments. */
|
||||
public interface Function18<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, out R> {
|
||||
public interface Function18<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18): R
|
||||
}
|
||||
/** A function that takes 19 arguments. */
|
||||
public interface Function19<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, out R> {
|
||||
public interface Function19<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19): R
|
||||
}
|
||||
/** A function that takes 20 arguments. */
|
||||
public interface Function20<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, out R> {
|
||||
public interface Function20<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19, p20: P20): R
|
||||
}
|
||||
/** A function that takes 21 arguments. */
|
||||
public interface Function21<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, in P21, out R> {
|
||||
public interface Function21<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, in P21, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19, p20: P20, p21: P21): R
|
||||
}
|
||||
/** A function that takes 22 arguments. */
|
||||
public interface Function22<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, in P21, in P22, out R> {
|
||||
public interface Function22<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, in P12, in P13, in P14, in P15, in P16, in P17, in P18, in P19, in P20, in P21, in P22, out R> : Function<R> {
|
||||
/** Invokes the function with the specified arguments. */
|
||||
public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19, p20: P20, p21: P21, p22: P22): R
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* 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 kotlin.reflect
|
||||
|
||||
/**
|
||||
* Represents an extension function.
|
||||
* See the [Kotlin language documentation](http://kotlinlang.org/docs/reference/extensions.html#extension-functions)
|
||||
* for more information.
|
||||
*
|
||||
* @param E the type of the extension receiver.
|
||||
* @param R the return type of the function.
|
||||
*/
|
||||
public interface KExtensionFunction<in E, out R> : KFunction<R>
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* 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 kotlin.reflect
|
||||
|
||||
/**
|
||||
* Represents a function with introspection capabilities.
|
||||
*/
|
||||
public interface KFunction<out R> : Function<R>
|
||||
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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 kotlin.reflect
|
||||
|
||||
/**
|
||||
* Represents a member function.
|
||||
*
|
||||
* @param T the type of the instance which should be used to call the function.
|
||||
* Must be derived either from a class declaring this function, or any subclass of that class.
|
||||
* @param R the return type of the function.
|
||||
*/
|
||||
public interface KMemberFunction<in T : Any, out R> : KFunction<R>
|
||||
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 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 kotlin.reflect
|
||||
|
||||
/**
|
||||
* Represents an extension function declared in a package.
|
||||
*
|
||||
* @param E the type of the extension receiver.
|
||||
* @param R the return type of the function.
|
||||
*/
|
||||
public interface KTopLevelExtensionFunction<in E, out R> : KExtensionFunction<E, R>
|
||||
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* 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 kotlin.reflect
|
||||
|
||||
/**
|
||||
* Represents a function declared in a package.
|
||||
*/
|
||||
public interface KTopLevelFunction<out R> : KFunction<R>
|
||||
@@ -58,15 +58,21 @@ class GenerateFunctions(out: PrintWriter, val kind: FunctionKind) : BuiltInsSour
|
||||
out.print("P$j, ")
|
||||
}
|
||||
|
||||
generateReturnTypeParameter(variance)
|
||||
|
||||
out.print(">")
|
||||
}
|
||||
|
||||
fun generateReturnTypeParameter(variance: Boolean) {
|
||||
if (variance) out.print("out ")
|
||||
out.print("R>")
|
||||
out.print("R")
|
||||
}
|
||||
|
||||
override fun generateBody() {
|
||||
for (i in 0..MAX_PARAM_COUNT) {
|
||||
generateDocumentation(i)
|
||||
out.print("public interface " + kind.getClassName(i))
|
||||
generateTypeParameters(i, true)
|
||||
generateTypeParameters(i, variance = true)
|
||||
generateSuperClass(i)
|
||||
generateFunctionClassBody(i)
|
||||
}
|
||||
@@ -81,7 +87,12 @@ class GenerateFunctions(out: PrintWriter, val kind: FunctionKind) : BuiltInsSour
|
||||
val superClass = kind.getSuperClassName(i)
|
||||
if (superClass != null) {
|
||||
out.print(" : $superClass")
|
||||
generateTypeParameters(i, false)
|
||||
generateTypeParameters(i, variance = false)
|
||||
}
|
||||
else {
|
||||
out.print(" : Function<")
|
||||
generateReturnTypeParameter(variance = false)
|
||||
out.print(">")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ import org.jetbrains.kotlin.j2k.ast.*
|
||||
import org.jetbrains.kotlin.j2k.ast.Annotation
|
||||
import org.jetbrains.kotlin.j2k.ast.Class
|
||||
import org.jetbrains.kotlin.j2k.ast.Enum
|
||||
import org.jetbrains.kotlin.j2k.ast.Function
|
||||
import org.jetbrains.kotlin.j2k.ast.Object
|
||||
import org.jetbrains.kotlin.j2k.usageProcessing.FieldToPropertyProcessing
|
||||
import org.jetbrains.kotlin.j2k.usageProcessing.UsageProcessing
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<include name="native/kotlin/Iterator.kt"/>
|
||||
<include name="native/kotlin/Collections.kt"/>
|
||||
<include name="src/kotlin/ExtensionFunctions.kt"/>
|
||||
<include name="src/kotlin/Function.kt"/>
|
||||
<include name="src/kotlin/Functions.kt"/>
|
||||
<include name="src/kotlin/Iterators.kt"/>
|
||||
<include name="src/kotlin/Range.kt"/>
|
||||
|
||||
Reference in New Issue
Block a user