Remove usages of Kotlin compiler built-ins (loaded from kotlin-compiler.jar's resources) (#323)
* Do not add dependency on compiler built-ins, add missing declarations * Drop most usages of KonanPlatform.builtIns Instead, lookup symbols through the module that is being compiled. This should be more correct because KonanPlatform.builtIns represents built-ins loaded from kotlin-compiler.jar's resources * Minor, make Context.moduleDescriptor lateinit and not null * Do not ever load KonanBuiltIns from Kotlin compiler anymore KonanBuiltIns.builtInsModule is now always the module that is being compiled at the moment. An instance of KonanBuiltIns is thus nothing more than a helper that loads classes with some predefined names from the module that is being compiled * Temporarily disable a part of IR validation
This commit is contained in:
committed by
Nikolay Igotti
parent
ccbf4bb963
commit
b08ccf07cb
@@ -48,6 +48,21 @@ public enum class DeprecationLevel {
|
||||
HIDDEN
|
||||
}
|
||||
|
||||
/**
|
||||
* Signifies that the annotated functional type represents an extension function.
|
||||
*/
|
||||
@Target(TYPE)
|
||||
@MustBeDocumented
|
||||
public annotation class ExtensionFunctionType
|
||||
|
||||
/**
|
||||
* Annotates type arguments of functional type and holds corresponding parameter name specified by the user in type declaration (if any).
|
||||
*/
|
||||
@Target(TYPE)
|
||||
@MustBeDocumented
|
||||
@SinceKotlin("1.1")
|
||||
public annotation class ParameterName(val name: String)
|
||||
|
||||
/**
|
||||
* Suppresses the given compilation warnings in the annotated element.
|
||||
* @property names names of the compiler diagnostics to suppress.
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
package kotlin
|
||||
|
||||
// (0..22).joinToString("\n") { i -> "interface Function$i<${(1..i).joinToString("") { j -> "in P$j, " }}out R> : Function<R> {\n operator fun invoke(${(1..i).joinToString { j -> "p$j: P$j" }}): R\n}\n" }
|
||||
|
||||
interface Function0<out R> : Function<R> {
|
||||
operator fun invoke(): R
|
||||
}
|
||||
|
||||
interface Function1<in P1, out R> : Function<R> {
|
||||
operator fun invoke(p1: P1): R
|
||||
}
|
||||
|
||||
interface Function2<in P1, in P2, out R> : Function<R> {
|
||||
operator fun invoke(p1: P1, p2: P2): R
|
||||
}
|
||||
|
||||
interface Function3<in P1, in P2, in P3, out R> : Function<R> {
|
||||
operator fun invoke(p1: P1, p2: P2, p3: P3): R
|
||||
}
|
||||
|
||||
interface Function4<in P1, in P2, in P3, in P4, out R> : Function<R> {
|
||||
operator fun invoke(p1: P1, p2: P2, p3: P3, p4: P4): R
|
||||
}
|
||||
|
||||
interface Function5<in P1, in P2, in P3, in P4, in P5, out R> : Function<R> {
|
||||
operator fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5): R
|
||||
}
|
||||
|
||||
interface Function6<in P1, in P2, in P3, in P4, in P5, in P6, out R> : Function<R> {
|
||||
operator fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6): R
|
||||
}
|
||||
|
||||
interface Function7<in P1, in P2, in P3, in P4, in P5, in P6, in P7, out R> : Function<R> {
|
||||
operator fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7): R
|
||||
}
|
||||
|
||||
interface Function8<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, out R> : Function<R> {
|
||||
operator fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8): R
|
||||
}
|
||||
|
||||
interface Function9<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, out R> : Function<R> {
|
||||
operator fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9): R
|
||||
}
|
||||
|
||||
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> {
|
||||
operator fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10): R
|
||||
}
|
||||
|
||||
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> {
|
||||
operator 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
|
||||
}
|
||||
|
||||
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> {
|
||||
operator 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
|
||||
}
|
||||
|
||||
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> {
|
||||
operator 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
|
||||
}
|
||||
|
||||
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> {
|
||||
operator 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
|
||||
}
|
||||
|
||||
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> {
|
||||
operator 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
|
||||
}
|
||||
|
||||
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> {
|
||||
operator 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
|
||||
}
|
||||
|
||||
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> {
|
||||
operator 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
|
||||
}
|
||||
|
||||
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> {
|
||||
operator 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
|
||||
}
|
||||
|
||||
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> {
|
||||
operator 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
|
||||
}
|
||||
|
||||
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> {
|
||||
operator 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
|
||||
}
|
||||
|
||||
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> {
|
||||
operator 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
|
||||
}
|
||||
|
||||
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> {
|
||||
operator 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,3 @@
|
||||
package kotlin.reflect
|
||||
|
||||
interface KFunction<out R> : KCallable<R>
|
||||
@@ -0,0 +1,50 @@
|
||||
package kotlin.reflect
|
||||
|
||||
// (0..22).joinToString("\n") { i -> "interface KFunction$i<${(1..i).joinToString("") { j -> "in P$j, " }}out R> : Function$i<${(1..i).joinToString("") { j -> "P$j, " }}R>, KFunction<R>\n" }
|
||||
|
||||
interface KFunction0<out R> : Function0<R>, KFunction<R>
|
||||
|
||||
interface KFunction1<in P1, out R> : Function1<P1, R>, KFunction<R>
|
||||
|
||||
interface KFunction2<in P1, in P2, out R> : Function2<P1, P2, R>, KFunction<R>
|
||||
|
||||
interface KFunction3<in P1, in P2, in P3, out R> : Function3<P1, P2, P3, R>, KFunction<R>
|
||||
|
||||
interface KFunction4<in P1, in P2, in P3, in P4, out R> : Function4<P1, P2, P3, P4, R>, KFunction<R>
|
||||
|
||||
interface KFunction5<in P1, in P2, in P3, in P4, in P5, out R> : Function5<P1, P2, P3, P4, P5, R>, KFunction<R>
|
||||
|
||||
interface KFunction6<in P1, in P2, in P3, in P4, in P5, in P6, out R> : Function6<P1, P2, P3, P4, P5, P6, R>, KFunction<R>
|
||||
|
||||
interface KFunction7<in P1, in P2, in P3, in P4, in P5, in P6, in P7, out R> : Function7<P1, P2, P3, P4, P5, P6, P7, R>, KFunction<R>
|
||||
|
||||
interface KFunction8<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, out R> : Function8<P1, P2, P3, P4, P5, P6, P7, P8, R>, KFunction<R>
|
||||
|
||||
interface KFunction9<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, out R> : Function9<P1, P2, P3, P4, P5, P6, P7, P8, P9, R>, KFunction<R>
|
||||
|
||||
interface KFunction10<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, out R> : Function10<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, R>, KFunction<R>
|
||||
|
||||
interface KFunction11<in P1, in P2, in P3, in P4, in P5, in P6, in P7, in P8, in P9, in P10, in P11, out R> : Function11<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, R>, KFunction<R>
|
||||
|
||||
interface KFunction12<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> : Function12<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, R>, KFunction<R>
|
||||
|
||||
interface KFunction13<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> : Function13<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, R>, KFunction<R>
|
||||
|
||||
interface KFunction14<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> : Function14<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, R>, KFunction<R>
|
||||
|
||||
interface KFunction15<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> : Function15<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, R>, KFunction<R>
|
||||
|
||||
interface KFunction16<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> : Function16<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, R>, KFunction<R>
|
||||
|
||||
interface KFunction17<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> : Function17<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, R>, KFunction<R>
|
||||
|
||||
interface KFunction18<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> : Function18<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, R>, KFunction<R>
|
||||
|
||||
interface KFunction19<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> : Function19<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, R>, KFunction<R>
|
||||
|
||||
interface KFunction20<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> : Function20<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, R>, KFunction<R>
|
||||
|
||||
interface KFunction21<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> : Function21<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, R>, KFunction<R>
|
||||
|
||||
interface KFunction22<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> : Function22<P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, P22, R>, KFunction<R>
|
||||
|
||||
Reference in New Issue
Block a user