[KLIB tool] Add tests for dumping IR signatures
^KT-62341
This commit is contained in:
committed by
Space Team
parent
a49723e35c
commit
93506bcb95
+31
@@ -0,0 +1,31 @@
|
||||
// Declared signatures: 8
|
||||
callables/Foo.<init>|-3340858080906402272[0]
|
||||
callables/Foo.list.<get-list>|423251439825877230[0]
|
||||
callables/Foo.list|-8464310926974581514[0]
|
||||
callables/Foo|null[0]
|
||||
callables/funWith1Parameter|-2692397571002661707[0]
|
||||
callables/funWith2Parameters|253442693142123504[0]
|
||||
callables/funWithLocalMembers|-2046106097692888239[0]
|
||||
callables/funWithoutParameters|-1655691975229201033[0]
|
||||
|
||||
// Imported signatures: 20
|
||||
kotlin.collections/Collection.iterator|8062689420742628886[0]
|
||||
kotlin.collections/Collection|null[0]
|
||||
kotlin.collections/Iterator|null[0]
|
||||
kotlin.collections/List.size.<get-size>|-8255337774232345969[0]
|
||||
kotlin.collections/List.size|-6253659984320132064[0]
|
||||
kotlin.collections/List|null[0]
|
||||
kotlin.collections/Map.Entry|null[0]
|
||||
kotlin.collections/Map.entries.<get-entries>|-3918723658541822269[0]
|
||||
kotlin.collections/Map.entries|-586096469347622282[0]
|
||||
kotlin.collections/Map|null[0]
|
||||
kotlin.collections/Set|null[0]
|
||||
kotlin/Any.<init>|-5645683436151566731[0]
|
||||
kotlin/Any|null[0]
|
||||
kotlin/Int.plus|4955128566171430399[0]
|
||||
kotlin/Int|null[0]
|
||||
kotlin/Nothing|null[0]
|
||||
kotlin/Pair.hashCode|3409210261493131192[0]
|
||||
kotlin/Pair|null[0]
|
||||
kotlin/String|null[0]
|
||||
kotlin/Unit|null[0]
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
// Declared signatures: 8
|
||||
callables/Foo.<init>|<init>(kotlin.collections.List<*>){}[0]
|
||||
callables/Foo.list.<get-list>|<get-list>(){}[0]
|
||||
callables/Foo.list|{}list[0]
|
||||
callables/Foo|null[0]
|
||||
callables/funWith1Parameter|funWith1Parameter(kotlin.collections.Map<*,*>){}[0]
|
||||
callables/funWith2Parameters|funWith2Parameters(kotlin.Pair<*,*>;callables.Foo){}[0]
|
||||
callables/funWithLocalMembers|funWithLocalMembers(){}[0]
|
||||
callables/funWithoutParameters|funWithoutParameters(){}[0]
|
||||
|
||||
// Imported signatures: 20
|
||||
kotlin.collections/Collection.iterator|iterator(){}[0]
|
||||
kotlin.collections/Collection|null[0]
|
||||
kotlin.collections/Iterator|null[0]
|
||||
kotlin.collections/List.size.<get-size>|<get-size>(){}[0]
|
||||
kotlin.collections/List.size|<get-size>(){}[0]
|
||||
kotlin.collections/List|null[0]
|
||||
kotlin.collections/Map.Entry|null[0]
|
||||
kotlin.collections/Map.entries.<get-entries>|<get-entries>(){}[0]
|
||||
kotlin.collections/Map.entries|<get-entries>(){}[0]
|
||||
kotlin.collections/Map|null[0]
|
||||
kotlin.collections/Set|null[0]
|
||||
kotlin/Any.<init>|<init>(){}[0]
|
||||
kotlin/Any|null[0]
|
||||
kotlin/Int.plus|plus(kotlin.Int){}[0]
|
||||
kotlin/Int|null[0]
|
||||
kotlin/Nothing|null[0]
|
||||
kotlin/Pair.hashCode|hashCode(){}[0]
|
||||
kotlin/Pair|null[0]
|
||||
kotlin/String|null[0]
|
||||
kotlin/Unit|null[0]
|
||||
@@ -0,0 +1,21 @@
|
||||
// FIR_IDENTICAL
|
||||
|
||||
package callables
|
||||
|
||||
class Foo(val list: List<*>)
|
||||
private class Bar(val collection: Collection<*>)
|
||||
|
||||
fun funWithoutParameters() = 42
|
||||
fun funWith1Parameter(map: Map<*, *>) = map.entries
|
||||
fun funWith2Parameters(pair: Pair<*, *>, foo: Foo) = pair.hashCode() + foo.list.size
|
||||
private fun funWithPrivateParameter(bar: Bar) = bar.collection.iterator()
|
||||
|
||||
fun funWithLocalMembers() {
|
||||
class LocalClass
|
||||
fun localFun() {
|
||||
LocalClass().toString()
|
||||
}
|
||||
localFun()
|
||||
}
|
||||
|
||||
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
// Declared signatures: 1
|
||||
imported/test|6620506149988718649[0]
|
||||
|
||||
// Imported signatures: 11
|
||||
bar/publicVal.<get-publicVal>|1629535235632860507[0]
|
||||
bar/publicVal|7143563926198876043[0]
|
||||
foo/PublicClass.<init>|-5182794243525578284[0]
|
||||
foo/PublicClass|null[0]
|
||||
foo/publicFun|-6665644650067461598[0]
|
||||
kotlin.collections/List|null[0]
|
||||
kotlin/Any|null[0]
|
||||
kotlin/CharSequence|null[0]
|
||||
kotlin/String|null[0]
|
||||
kotlin/Unit|null[0]
|
||||
kotlin/toString|-1490169857175896877[0]
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
// Declared signatures: 1
|
||||
imported/test|test(){}[0]
|
||||
|
||||
// Imported signatures: 11
|
||||
bar/publicVal.<get-publicVal>|<get-publicVal>(){}[0]
|
||||
bar/publicVal|<get-publicVal>(){}[0]
|
||||
foo/PublicClass.<init>|<init>(kotlin.Int){}[0]
|
||||
foo/PublicClass|null[0]
|
||||
foo/publicFun|publicFun(){}[0]
|
||||
kotlin.collections/List|null[0]
|
||||
kotlin/Any|null[0]
|
||||
kotlin/CharSequence|null[0]
|
||||
kotlin/String|null[0]
|
||||
kotlin/Unit|null[0]
|
||||
kotlin/toString|toString@kotlin.Any?(){}[0]
|
||||
@@ -0,0 +1,13 @@
|
||||
// FIR_IDENTICAL
|
||||
|
||||
package imported
|
||||
|
||||
private fun consume(anything: Any?) {
|
||||
anything.toString()
|
||||
}
|
||||
|
||||
fun test() {
|
||||
consume(foo.publicFun())
|
||||
consume(bar.publicVal)
|
||||
consume(foo.PublicClass())
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package bar
|
||||
|
||||
private fun privateFun(): Set<Int> = hashSetOf(1, 2, 3)
|
||||
fun publicFun() = privateFun()
|
||||
|
||||
private val privateVal: List<String> get() = mutableListOf("foo", "bar")
|
||||
val publicVal get() = privateVal
|
||||
|
||||
private class PrivateClass(val collection: Collection<*> = privateFun())
|
||||
class PublicClass(val iterator: Iterator<*> = privateVal.iterator())
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
package foo
|
||||
|
||||
private fun privateFun(): CharSequence = "hello"
|
||||
fun publicFun() = privateFun()
|
||||
|
||||
private val privateVal: Appendable get() = StringBuilder()
|
||||
val publicVal get() = privateVal
|
||||
|
||||
private class PrivateClass(val length: Int = privateVal.toString().length)
|
||||
class PublicClass(val length: Int = privateFun().length)
|
||||
Vendored
+58
@@ -0,0 +1,58 @@
|
||||
// Declared signatures: 18
|
||||
imported_from_cinterop.main/Derived.<init>|-5645683436151566731[0]
|
||||
imported_from_cinterop.main/Derived.equals|-2081205089284609834[0]
|
||||
imported_from_cinterop.main/Derived.hashCode|3409210261493131192[0]
|
||||
imported_from_cinterop.main/Derived.init|-3274032692079634155[0]
|
||||
imported_from_cinterop.main/Derived.nonOverriddenFunction|3505898422087519936[0]
|
||||
imported_from_cinterop.main/Derived.nonOverriddenProperty.<get-nonOverriddenProperty>|2758692278606108838[0]
|
||||
imported_from_cinterop.main/Derived.nonOverriddenProperty.<set-nonOverriddenProperty>|-2229258798912660779[0]
|
||||
imported_from_cinterop.main/Derived.nonOverriddenProperty|-355772021403371063[0]
|
||||
imported_from_cinterop.main/Derived.nonOverriddenProperty|-9006076905898583858[0]
|
||||
imported_from_cinterop.main/Derived.overriddenFunction|-6472102329825707726[0]
|
||||
imported_from_cinterop.main/Derived.overriddenProperty.<get-overriddenProperty>|7022302077100732862[0]
|
||||
imported_from_cinterop.main/Derived.overriddenProperty.<set-overriddenProperty>|-4304223391766217362[0]
|
||||
imported_from_cinterop.main/Derived.overriddenProperty|-1390063372067425061[0]
|
||||
imported_from_cinterop.main/Derived.overriddenProperty|-7224960608403565684[0]
|
||||
imported_from_cinterop.main/Derived.setNonOverriddenProperty|-5242067576658008142[0]
|
||||
imported_from_cinterop.main/Derived.setOverriddenProperty|-8479216322956180924[0]
|
||||
imported_from_cinterop.main/Derived.toString|-1522858123163872138[0]
|
||||
imported_from_cinterop.main/Derived|null[0]
|
||||
|
||||
// Imported signatures: 37
|
||||
imported_from_cinterop.lib/Base.<init>|2170982204859394228[100]
|
||||
imported_from_cinterop.lib/Base.equals|-2081205089284609834[100]
|
||||
imported_from_cinterop.lib/Base.hashCode|3409210261493131192[100]
|
||||
imported_from_cinterop.lib/Base.init|-3274032692079634155[100]
|
||||
imported_from_cinterop.lib/Base.nonOverriddenFunction|3505898422087519936[100]
|
||||
imported_from_cinterop.lib/Base.nonOverriddenProperty.<get-nonOverriddenProperty>|2758692278606108838[100]
|
||||
imported_from_cinterop.lib/Base.nonOverriddenProperty.<set-nonOverriddenProperty>|-2229258798912660779[100]
|
||||
imported_from_cinterop.lib/Base.nonOverriddenProperty|-355772021403371063[100]
|
||||
imported_from_cinterop.lib/Base.nonOverriddenProperty|-9006076905898583858[100]
|
||||
imported_from_cinterop.lib/Base.overriddenFunction|-6472102329825707726[100]
|
||||
imported_from_cinterop.lib/Base.overriddenProperty.<get-overriddenProperty>|7022302077100732862[100]
|
||||
imported_from_cinterop.lib/Base.overriddenProperty.<set-overriddenProperty>|-4304223391766217362[100]
|
||||
imported_from_cinterop.lib/Base.overriddenProperty|-1390063372067425061[100]
|
||||
imported_from_cinterop.lib/Base.overriddenProperty|-7224960608403565684[100]
|
||||
imported_from_cinterop.lib/Base.setNonOverriddenProperty|-5242067576658008142[100]
|
||||
imported_from_cinterop.lib/Base.setOverriddenProperty|-8479216322956180924[100]
|
||||
imported_from_cinterop.lib/Base.toString|-1522858123163872138[100]
|
||||
imported_from_cinterop.lib/Base|null[100]
|
||||
kotlin.reflect/KClass|null[0]
|
||||
kotlin/Annotation|null[0]
|
||||
kotlin/Any|null[0]
|
||||
kotlin/Array|null[0]
|
||||
kotlin/Boolean|null[0]
|
||||
kotlin/Deprecated.<init>|5811760367707941525[0]
|
||||
kotlin/DeprecationLevel.ERROR|null[0]
|
||||
kotlin/DeprecationLevel|null[0]
|
||||
kotlin/Int|null[0]
|
||||
kotlin/Nothing|null[0]
|
||||
kotlin/OptIn.<init>|2217502803210275401[0]
|
||||
kotlin/ReplaceWith.<init>|3004747395474106658[0]
|
||||
kotlin/ReplaceWith|null[0]
|
||||
kotlin/String|null[0]
|
||||
kotlin/Unit|null[0]
|
||||
kotlinx.cinterop.internal/CCall.ConsumesReceiver.<init>|-5645683436151566731[0]
|
||||
kotlinx.cinterop.internal/CCall.ReturnsRetained.<init>|-5645683436151566731[0]
|
||||
kotlinx.cinterop/ExperimentalForeignApi|null[0]
|
||||
kotlinx.cinterop/ObjCMethod.<init>|1537530705165382920[0]
|
||||
Vendored
+58
@@ -0,0 +1,58 @@
|
||||
// Declared signatures: 18
|
||||
imported_from_cinterop.main/Derived.<init>|<init>(){}[0]
|
||||
imported_from_cinterop.main/Derived.equals|equals(other:kotlin.Any?){}[0]
|
||||
imported_from_cinterop.main/Derived.hashCode|hashCode(){}[0]
|
||||
imported_from_cinterop.main/Derived.init|objc:init[0]
|
||||
imported_from_cinterop.main/Derived.nonOverriddenFunction|objc:nonOverriddenFunction[0]
|
||||
imported_from_cinterop.main/Derived.nonOverriddenProperty.<get-nonOverriddenProperty>|objc:nonOverriddenProperty#Accessor[0]
|
||||
imported_from_cinterop.main/Derived.nonOverriddenProperty.<set-nonOverriddenProperty>|objc:setNonOverriddenProperty:#Accessor[0]
|
||||
imported_from_cinterop.main/Derived.nonOverriddenProperty|objc:nonOverriddenProperty[0]
|
||||
imported_from_cinterop.main/Derived.nonOverriddenProperty|{}nonOverriddenProperty[0]
|
||||
imported_from_cinterop.main/Derived.overriddenFunction|objc:overriddenFunction[0]
|
||||
imported_from_cinterop.main/Derived.overriddenProperty.<get-overriddenProperty>|objc:overriddenProperty#Accessor[0]
|
||||
imported_from_cinterop.main/Derived.overriddenProperty.<set-overriddenProperty>|objc:setOverriddenProperty:#Accessor[0]
|
||||
imported_from_cinterop.main/Derived.overriddenProperty|objc:overriddenProperty[0]
|
||||
imported_from_cinterop.main/Derived.overriddenProperty|{}overriddenProperty[0]
|
||||
imported_from_cinterop.main/Derived.setNonOverriddenProperty|objc:setNonOverriddenProperty:[0]
|
||||
imported_from_cinterop.main/Derived.setOverriddenProperty|objc:setOverriddenProperty:[0]
|
||||
imported_from_cinterop.main/Derived.toString|toString(){}[0]
|
||||
imported_from_cinterop.main/Derived|null[0]
|
||||
|
||||
// Imported signatures: 37
|
||||
imported_from_cinterop.lib/Base.<init>|objc:init#Constructor[100]
|
||||
imported_from_cinterop.lib/Base.equals|equals(other:kotlin.Any?){}[100]
|
||||
imported_from_cinterop.lib/Base.hashCode|hashCode(){}[100]
|
||||
imported_from_cinterop.lib/Base.init|objc:init[100]
|
||||
imported_from_cinterop.lib/Base.nonOverriddenFunction|objc:nonOverriddenFunction[100]
|
||||
imported_from_cinterop.lib/Base.nonOverriddenProperty.<get-nonOverriddenProperty>|objc:nonOverriddenProperty#Accessor[100]
|
||||
imported_from_cinterop.lib/Base.nonOverriddenProperty.<set-nonOverriddenProperty>|objc:setNonOverriddenProperty:#Accessor[100]
|
||||
imported_from_cinterop.lib/Base.nonOverriddenProperty|objc:nonOverriddenProperty#Accessor[100]
|
||||
imported_from_cinterop.lib/Base.nonOverriddenProperty|objc:nonOverriddenProperty[100]
|
||||
imported_from_cinterop.lib/Base.overriddenFunction|objc:overriddenFunction[100]
|
||||
imported_from_cinterop.lib/Base.overriddenProperty.<get-overriddenProperty>|objc:overriddenProperty#Accessor[100]
|
||||
imported_from_cinterop.lib/Base.overriddenProperty.<set-overriddenProperty>|objc:setOverriddenProperty:#Accessor[100]
|
||||
imported_from_cinterop.lib/Base.overriddenProperty|objc:overriddenProperty#Accessor[100]
|
||||
imported_from_cinterop.lib/Base.overriddenProperty|objc:overriddenProperty[100]
|
||||
imported_from_cinterop.lib/Base.setNonOverriddenProperty|objc:setNonOverriddenProperty:[100]
|
||||
imported_from_cinterop.lib/Base.setOverriddenProperty|objc:setOverriddenProperty:[100]
|
||||
imported_from_cinterop.lib/Base.toString|toString(){}[100]
|
||||
imported_from_cinterop.lib/Base|null[100]
|
||||
kotlin.reflect/KClass|null[0]
|
||||
kotlin/Annotation|null[0]
|
||||
kotlin/Any|null[0]
|
||||
kotlin/Array|null[0]
|
||||
kotlin/Boolean|null[0]
|
||||
kotlin/Deprecated.<init>|<init>(kotlin.String;kotlin.ReplaceWith;kotlin.DeprecationLevel){}[0]
|
||||
kotlin/DeprecationLevel.ERROR|null[0]
|
||||
kotlin/DeprecationLevel|null[0]
|
||||
kotlin/Int|null[0]
|
||||
kotlin/Nothing|null[0]
|
||||
kotlin/OptIn.<init>|<init>(kotlin.Array<out|kotlin.reflect.KClass<out|kotlin.Annotation>>...){}[0]
|
||||
kotlin/ReplaceWith.<init>|<init>(kotlin.String;kotlin.Array<out|kotlin.String>...){}[0]
|
||||
kotlin/ReplaceWith|null[0]
|
||||
kotlin/String|null[0]
|
||||
kotlin/Unit|null[0]
|
||||
kotlinx.cinterop.internal/CCall.ConsumesReceiver.<init>|<init>(){}[0]
|
||||
kotlinx.cinterop.internal/CCall.ReturnsRetained.<init>|<init>(){}[0]
|
||||
kotlinx.cinterop/ExperimentalForeignApi|null[0]
|
||||
kotlinx.cinterop/ObjCMethod.<init>|<init>(kotlin.String;kotlin.String;kotlin.Boolean){}[0]
|
||||
@@ -0,0 +1,17 @@
|
||||
// FIR_IDENTICAL
|
||||
|
||||
package imported_from_cinterop.main
|
||||
|
||||
import imported_from_cinterop.lib.Base
|
||||
|
||||
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
|
||||
class Derived : Base() {
|
||||
override fun overriddenFunction() = Unit
|
||||
//override fun nonOverriddenFunction() = Unit
|
||||
|
||||
override fun overriddenProperty(): Int = 42
|
||||
//override fun nonOverriddenProperty(): Int = 42
|
||||
|
||||
override fun setOverriddenProperty(overriddenProperty: Int) = Unit
|
||||
//override fun setNonOverriddenProperty(nonOverriddenProperty: Int) = Unit
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
language = Objective-C
|
||||
package = imported_from_cinterop.lib
|
||||
---
|
||||
@interface Base
|
||||
-(instancetype) init;
|
||||
-(void) overriddenFunction;
|
||||
-(void) nonOverriddenFunction;
|
||||
@property int overriddenProperty;
|
||||
@property int nonOverriddenProperty;
|
||||
@end
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
// Declared signatures: 25
|
||||
type_parameters/Class.<init>|-8731461708390519279[0]
|
||||
type_parameters/Class.Inner.<init>|1783188413903974791[0]
|
||||
type_parameters/Class.Inner.p2.<get-p2>|3135798795606784082[0]
|
||||
type_parameters/Class.Inner.p2|1837305664617486052[0]
|
||||
type_parameters/Class.Inner.q2.<get-q2>|1581299660970715646[0]
|
||||
type_parameters/Class.Inner.q2|-1627953700386837072[0]
|
||||
type_parameters/Class.Inner|null[0]
|
||||
type_parameters/Class.Nested.<init>|-8731461708390519279[0]
|
||||
type_parameters/Class.Nested.q1.<get-q1>|-2187816410000771818[0]
|
||||
type_parameters/Class.Nested.q1|-1786398010950985798[0]
|
||||
type_parameters/Class.Nested|null[0]
|
||||
type_parameters/Class.p1.<get-p1>|419663188770843259[0]
|
||||
type_parameters/Class.p1|7711764890799440087[0]
|
||||
type_parameters/Class|null[0]
|
||||
type_parameters/FinalClass.<init>|-8731461708390519279[0]
|
||||
type_parameters/FinalClass.p2.<get-p2>|3135798795606784082[0]
|
||||
type_parameters/FinalClass.p2|1837305664617486052[0]
|
||||
type_parameters/FinalClass|null[0]
|
||||
type_parameters/OpenClass.<init>|-6137285739236751325[0]
|
||||
type_parameters/OpenClass.p1.<get-p1>|419663188770843259[0]
|
||||
type_parameters/OpenClass.p1|7711764890799440087[0]
|
||||
type_parameters/OpenClass|null[0]
|
||||
type_parameters/function|-4296911800141380254[0]
|
||||
type_parameters/property.<get-property>|-6424239601896786367[0]
|
||||
type_parameters/property|4472899887396146803[0]
|
||||
|
||||
// Imported signatures: 15
|
||||
kotlin.collections/Collection|null[0]
|
||||
kotlin.collections/List|null[0]
|
||||
kotlin.collections/MutableCollection|null[0]
|
||||
kotlin.collections/MutableMap|null[0]
|
||||
kotlin.collections/MutableSet|null[0]
|
||||
kotlin.collections/Set|null[0]
|
||||
kotlin.text/Appendable|null[0]
|
||||
kotlin/Any.<init>|-5645683436151566731[0]
|
||||
kotlin/Any|null[0]
|
||||
kotlin/CharSequence|null[0]
|
||||
kotlin/Nothing|null[0]
|
||||
kotlin/Number|null[0]
|
||||
kotlin/String|null[0]
|
||||
kotlin/Unit|null[0]
|
||||
kotlin/toString|-1490169857175896877[0]
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
// Declared signatures: 25
|
||||
type_parameters/Class.<init>|<init>(1:0){}[0]
|
||||
type_parameters/Class.Inner.<init>|<init>(2:1;1:0){}[0]
|
||||
type_parameters/Class.Inner.p2.<get-p2>|<get-p2>(){}[0]
|
||||
type_parameters/Class.Inner.p2|{}p2[0]
|
||||
type_parameters/Class.Inner.q2.<get-q2>|<get-q2>(){}[0]
|
||||
type_parameters/Class.Inner.q2|{}q2[0]
|
||||
type_parameters/Class.Inner|null[0]
|
||||
type_parameters/Class.Nested.<init>|<init>(1:0){}[0]
|
||||
type_parameters/Class.Nested.q1.<get-q1>|<get-q1>(){}[0]
|
||||
type_parameters/Class.Nested.q1|{}q1[0]
|
||||
type_parameters/Class.Nested|null[0]
|
||||
type_parameters/Class.p1.<get-p1>|<get-p1>(){}[0]
|
||||
type_parameters/Class.p1|{}p1[0]
|
||||
type_parameters/Class|null[0]
|
||||
type_parameters/FinalClass.<init>|<init>(1:0){}[0]
|
||||
type_parameters/FinalClass.p2.<get-p2>|<get-p2>(){}[0]
|
||||
type_parameters/FinalClass.p2|{}p2[0]
|
||||
type_parameters/FinalClass|null[0]
|
||||
type_parameters/OpenClass.<init>|<init>(1:0?){}[0]
|
||||
type_parameters/OpenClass.p1.<get-p1>|<get-p1>(){}[0]
|
||||
type_parameters/OpenClass.p1|{}p1[0]
|
||||
type_parameters/OpenClass|null[0]
|
||||
type_parameters/function|function(0:0){0§<kotlin.CharSequence>;1§<kotlin.collections.Collection<*>>;2§<kotlin.collections.List<*>>}[0]
|
||||
type_parameters/property.<get-property>|<get-property>@0:0(){0§<kotlin.Number>}[0]
|
||||
type_parameters/property|@0:0{0§<kotlin.Number>}property[0]
|
||||
|
||||
// Imported signatures: 15
|
||||
kotlin.collections/Collection|null[0]
|
||||
kotlin.collections/List|null[0]
|
||||
kotlin.collections/MutableCollection|null[0]
|
||||
kotlin.collections/MutableMap|null[0]
|
||||
kotlin.collections/MutableSet|null[0]
|
||||
kotlin.collections/Set|null[0]
|
||||
kotlin.text/Appendable|null[0]
|
||||
kotlin/Any.<init>|<init>(){}[0]
|
||||
kotlin/Any|null[0]
|
||||
kotlin/CharSequence|null[0]
|
||||
kotlin/Nothing|null[0]
|
||||
kotlin/Number|null[0]
|
||||
kotlin/String|null[0]
|
||||
kotlin/Unit|null[0]
|
||||
kotlin/toString|toString@kotlin.Any?(){}[0]
|
||||
@@ -0,0 +1,48 @@
|
||||
// FIR_IDENTICAL
|
||||
|
||||
package type_parameters
|
||||
|
||||
private fun consume(anything: Any?) {
|
||||
anything.toString()
|
||||
}
|
||||
|
||||
fun <P1 : CharSequence, P2 : Collection<*>, P3 : List<*>> function(p1: P1) {
|
||||
consume(p1)
|
||||
|
||||
fun local1(p2: P2?) { consume(p2) }
|
||||
local1(null)
|
||||
|
||||
fun <Q1 : Set<*>> local2(q1: Q1?) { consume(q1) }
|
||||
local2(null)
|
||||
|
||||
class Local1(val p3: P3?)
|
||||
consume(Local1(null))
|
||||
|
||||
class Local2<Q2 : Appendable>(val q2: Q2?)
|
||||
consume(Local2(null))
|
||||
}
|
||||
|
||||
val <P1 : Number> P1.property: P1
|
||||
get() {
|
||||
fun local1(p1: P1?) { consume(p1) }
|
||||
local1(null)
|
||||
|
||||
fun <Q1 : MutableCollection<*>> local2(q1: Q1?) { consume(q1) }
|
||||
local2(null)
|
||||
|
||||
class Local1(val p1: P1?)
|
||||
consume(Local1(null))
|
||||
|
||||
class Local2<Q2 : MutableSet<*>>(val q2: Q2?)
|
||||
consume(Local2(null))
|
||||
|
||||
return this
|
||||
}
|
||||
|
||||
class Class<P1, P2>(val p1: P1) {
|
||||
class Nested<Q1>(val q1: Q1)
|
||||
inner class Inner<Q2>(val p2: P2, val q2: Q2)
|
||||
}
|
||||
|
||||
open class OpenClass<P1>(val p1: P1?)
|
||||
class FinalClass<P2>(val p2: P2) : OpenClass<MutableMap<*, *>>(null)
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
// Declared signatures: 98
|
||||
visibility/InternalClass.<init>|1280618353163213788[0]
|
||||
visibility/InternalClass.NestedClass.<init>|-5645683436151566731[0]
|
||||
visibility/InternalClass.NestedClass|null[0]
|
||||
visibility/InternalClass.function|-3322893411126713785[0]
|
||||
visibility/InternalClass.property.<get-property>|4838831487146901942[0]
|
||||
visibility/InternalClass.property|4634558160746314112[0]
|
||||
visibility/InternalClass|null[0]
|
||||
visibility/InternalPAClass.<init>|1280618353163213788[0]
|
||||
visibility/InternalPAClass.NestedClass.<init>|-5645683436151566731[0]
|
||||
visibility/InternalPAClass.NestedClass|null[0]
|
||||
visibility/InternalPAClass.function|-3322893411126713785[0]
|
||||
visibility/InternalPAClass.property.<get-property>|4838831487146901942[0]
|
||||
visibility/InternalPAClass.property|4634558160746314112[0]
|
||||
visibility/InternalPAClassInternalMembers.<init>|1280618353163213788[0]
|
||||
visibility/InternalPAClassInternalMembers.NestedClass.<init>|-5645683436151566731[0]
|
||||
visibility/InternalPAClassInternalMembers.NestedClass|null[0]
|
||||
visibility/InternalPAClassInternalMembers.function|-3322893411126713785[0]
|
||||
visibility/InternalPAClassInternalMembers.property.<get-property>|4838831487146901942[0]
|
||||
visibility/InternalPAClassInternalMembers.property|4634558160746314112[0]
|
||||
visibility/InternalPAClassInternalMembers|null[0]
|
||||
visibility/InternalPAClassInternalPAMembers.<init>|1280618353163213788[0]
|
||||
visibility/InternalPAClassInternalPAMembers.NestedClass.<init>|-5645683436151566731[0]
|
||||
visibility/InternalPAClassInternalPAMembers.NestedClass|null[0]
|
||||
visibility/InternalPAClassInternalPAMembers.function|-3322893411126713785[0]
|
||||
visibility/InternalPAClassInternalPAMembers.property.<get-property>|4838831487146901942[0]
|
||||
visibility/InternalPAClassInternalPAMembers.property|4634558160746314112[0]
|
||||
visibility/InternalPAClassInternalPAMembers|null[0]
|
||||
visibility/InternalPAClass|null[0]
|
||||
visibility/InternalTypeAlias|null[0]
|
||||
visibility/PublicAbstractClassProtectedMembers.<init>|1280618353163213788[0]
|
||||
visibility/PublicAbstractClassProtectedMembers.NestedClass.<init>|-5645683436151566731[0]
|
||||
visibility/PublicAbstractClassProtectedMembers.NestedClass|null[0]
|
||||
visibility/PublicAbstractClassProtectedMembers.function|-3322893411126713785[0]
|
||||
visibility/PublicAbstractClassProtectedMembers.property.<get-property>|4838831487146901942[0]
|
||||
visibility/PublicAbstractClassProtectedMembers.property|4634558160746314112[0]
|
||||
visibility/PublicAbstractClassProtectedMembers|null[0]
|
||||
visibility/PublicClass.<init>|1280618353163213788[0]
|
||||
visibility/PublicClass.NestedClass.<init>|-5645683436151566731[0]
|
||||
visibility/PublicClass.NestedClass|null[0]
|
||||
visibility/PublicClass.function|-3322893411126713785[0]
|
||||
visibility/PublicClass.property.<get-property>|4838831487146901942[0]
|
||||
visibility/PublicClass.property|4634558160746314112[0]
|
||||
visibility/PublicClassInternalMembers.<init>|1280618353163213788[0]
|
||||
visibility/PublicClassInternalMembers.NestedClass.<init>|-5645683436151566731[0]
|
||||
visibility/PublicClassInternalMembers.NestedClass|null[0]
|
||||
visibility/PublicClassInternalMembers.function|-3322893411126713785[0]
|
||||
visibility/PublicClassInternalMembers.property.<get-property>|4838831487146901942[0]
|
||||
visibility/PublicClassInternalMembers.property|4634558160746314112[0]
|
||||
visibility/PublicClassInternalMembers|null[0]
|
||||
visibility/PublicClassInternalPAMembers.<init>|1280618353163213788[0]
|
||||
visibility/PublicClassInternalPAMembers.NestedClass.<init>|-5645683436151566731[0]
|
||||
visibility/PublicClassInternalPAMembers.NestedClass|null[0]
|
||||
visibility/PublicClassInternalPAMembers.function|-3322893411126713785[0]
|
||||
visibility/PublicClassInternalPAMembers.property.<get-property>|4838831487146901942[0]
|
||||
visibility/PublicClassInternalPAMembers.property|4634558160746314112[0]
|
||||
visibility/PublicClassInternalPAMembers|null[0]
|
||||
visibility/PublicClassPrivateMembers|null[0]
|
||||
visibility/PublicClassProtectedMembers.<init>|1280618353163213788[0]
|
||||
visibility/PublicClassProtectedMembers.NestedClass.<init>|-5645683436151566731[0]
|
||||
visibility/PublicClassProtectedMembers.NestedClass|null[0]
|
||||
visibility/PublicClassProtectedMembers.function|-3322893411126713785[0]
|
||||
visibility/PublicClassProtectedMembers.property.<get-property>|4838831487146901942[0]
|
||||
visibility/PublicClassProtectedMembers.property|4634558160746314112[0]
|
||||
visibility/PublicClassProtectedMembers|null[0]
|
||||
visibility/PublicClass|null[0]
|
||||
visibility/PublicOpenClassProtectedMembers.<init>|1280618353163213788[0]
|
||||
visibility/PublicOpenClassProtectedMembers.NestedClass.<init>|-5645683436151566731[0]
|
||||
visibility/PublicOpenClassProtectedMembers.NestedClass|null[0]
|
||||
visibility/PublicOpenClassProtectedMembers.function|-3322893411126713785[0]
|
||||
visibility/PublicOpenClassProtectedMembers.property.<get-property>|4838831487146901942[0]
|
||||
visibility/PublicOpenClassProtectedMembers.property|4634558160746314112[0]
|
||||
visibility/PublicOpenClassProtectedMembers|null[0]
|
||||
visibility/PublicTypeAlias|null[0]
|
||||
visibility/internalFun|1659039888467355008[0]
|
||||
visibility/internalPAFun|6209200454159161588[0]
|
||||
visibility/internalPAVal.<get-internalPAVal>|-2220884681594955448[0]
|
||||
visibility/internalPAVal|-6296713716360945427[0]
|
||||
visibility/internalPAVarInternalSetter.<get-internalPAVarInternalSetter>|-2165138686967166236[0]
|
||||
visibility/internalPAVarInternalSetter.<set-internalPAVarInternalSetter>|4268094736790597293[0]
|
||||
visibility/internalPAVarInternalSetter|8606185858874286601[0]
|
||||
visibility/internalPAVarPrivateSetter.<get-internalPAVarPrivateSetter>|7858377503331561427[0]
|
||||
visibility/internalPAVarPrivateSetter|5404459463495216914[0]
|
||||
visibility/internalVal.<get-internalVal>|893019050309271437[0]
|
||||
visibility/internalVal|-5707689433692618866[0]
|
||||
visibility/internalVar.<get-internalVar>|-6573080696143133343[0]
|
||||
visibility/internalVar.<set-internalVar>|-3057928575244553927[0]
|
||||
visibility/internalVar|5445389237960049491[0]
|
||||
visibility/publicFun|-6665644650067461598[0]
|
||||
visibility/publicVal.<get-publicVal>|1629535235632860507[0]
|
||||
visibility/publicVal|7143563926198876043[0]
|
||||
visibility/publicVarInternalSetter.<get-publicVarInternalSetter>|-5725447636241167149[0]
|
||||
visibility/publicVarInternalSetter.<set-publicVarInternalSetter>|6315993282168943718[0]
|
||||
visibility/publicVarInternalSetter|-2855768891968336973[0]
|
||||
visibility/publicVarPrivateSetter.<get-publicVarPrivateSetter>|4875313296516845411[0]
|
||||
visibility/publicVarPrivateSetter|8666989530943431000[0]
|
||||
visibility/publicVarPublicSetter.<get-publicVarPublicSetter>|3106038528912026803[0]
|
||||
visibility/publicVarPublicSetter.<set-publicVarPublicSetter>|7158661382309278782[0]
|
||||
visibility/publicVarPublicSetter|2172609198358158808[0]
|
||||
|
||||
// Imported signatures: 6
|
||||
kotlin/Any.<init>|-5645683436151566731[0]
|
||||
kotlin/Any|null[0]
|
||||
kotlin/Nothing|null[0]
|
||||
kotlin/PublishedApi.<init>|-5645683436151566731[0]
|
||||
kotlin/String|null[0]
|
||||
kotlin/Unit|null[0]
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
// Declared signatures: 98
|
||||
visibility/InternalClass.<init>|<init>(kotlin.String){}[0]
|
||||
visibility/InternalClass.NestedClass.<init>|<init>(){}[0]
|
||||
visibility/InternalClass.NestedClass|null[0]
|
||||
visibility/InternalClass.function|function(){}[0]
|
||||
visibility/InternalClass.property.<get-property>|<get-property>(){}[0]
|
||||
visibility/InternalClass.property|{}property[0]
|
||||
visibility/InternalClass|null[0]
|
||||
visibility/InternalPAClass.<init>|<init>(kotlin.String){}[0]
|
||||
visibility/InternalPAClass.NestedClass.<init>|<init>(){}[0]
|
||||
visibility/InternalPAClass.NestedClass|null[0]
|
||||
visibility/InternalPAClass.function|function(){}[0]
|
||||
visibility/InternalPAClass.property.<get-property>|<get-property>(){}[0]
|
||||
visibility/InternalPAClass.property|{}property[0]
|
||||
visibility/InternalPAClassInternalMembers.<init>|<init>(kotlin.String){}[0]
|
||||
visibility/InternalPAClassInternalMembers.NestedClass.<init>|<init>(){}[0]
|
||||
visibility/InternalPAClassInternalMembers.NestedClass|null[0]
|
||||
visibility/InternalPAClassInternalMembers.function|function(){}[0]
|
||||
visibility/InternalPAClassInternalMembers.property.<get-property>|<get-property>(){}[0]
|
||||
visibility/InternalPAClassInternalMembers.property|{}property[0]
|
||||
visibility/InternalPAClassInternalMembers|null[0]
|
||||
visibility/InternalPAClassInternalPAMembers.<init>|<init>(kotlin.String){}[0]
|
||||
visibility/InternalPAClassInternalPAMembers.NestedClass.<init>|<init>(){}[0]
|
||||
visibility/InternalPAClassInternalPAMembers.NestedClass|null[0]
|
||||
visibility/InternalPAClassInternalPAMembers.function|function(){}[0]
|
||||
visibility/InternalPAClassInternalPAMembers.property.<get-property>|<get-property>(){}[0]
|
||||
visibility/InternalPAClassInternalPAMembers.property|{}property[0]
|
||||
visibility/InternalPAClassInternalPAMembers|null[0]
|
||||
visibility/InternalPAClass|null[0]
|
||||
visibility/InternalTypeAlias|null[0]
|
||||
visibility/PublicAbstractClassProtectedMembers.<init>|<init>(kotlin.String){}[0]
|
||||
visibility/PublicAbstractClassProtectedMembers.NestedClass.<init>|<init>(){}[0]
|
||||
visibility/PublicAbstractClassProtectedMembers.NestedClass|null[0]
|
||||
visibility/PublicAbstractClassProtectedMembers.function|function(){}[0]
|
||||
visibility/PublicAbstractClassProtectedMembers.property.<get-property>|<get-property>(){}[0]
|
||||
visibility/PublicAbstractClassProtectedMembers.property|{}property[0]
|
||||
visibility/PublicAbstractClassProtectedMembers|null[0]
|
||||
visibility/PublicClass.<init>|<init>(kotlin.String){}[0]
|
||||
visibility/PublicClass.NestedClass.<init>|<init>(){}[0]
|
||||
visibility/PublicClass.NestedClass|null[0]
|
||||
visibility/PublicClass.function|function(){}[0]
|
||||
visibility/PublicClass.property.<get-property>|<get-property>(){}[0]
|
||||
visibility/PublicClass.property|{}property[0]
|
||||
visibility/PublicClassInternalMembers.<init>|<init>(kotlin.String){}[0]
|
||||
visibility/PublicClassInternalMembers.NestedClass.<init>|<init>(){}[0]
|
||||
visibility/PublicClassInternalMembers.NestedClass|null[0]
|
||||
visibility/PublicClassInternalMembers.function|function(){}[0]
|
||||
visibility/PublicClassInternalMembers.property.<get-property>|<get-property>(){}[0]
|
||||
visibility/PublicClassInternalMembers.property|{}property[0]
|
||||
visibility/PublicClassInternalMembers|null[0]
|
||||
visibility/PublicClassInternalPAMembers.<init>|<init>(kotlin.String){}[0]
|
||||
visibility/PublicClassInternalPAMembers.NestedClass.<init>|<init>(){}[0]
|
||||
visibility/PublicClassInternalPAMembers.NestedClass|null[0]
|
||||
visibility/PublicClassInternalPAMembers.function|function(){}[0]
|
||||
visibility/PublicClassInternalPAMembers.property.<get-property>|<get-property>(){}[0]
|
||||
visibility/PublicClassInternalPAMembers.property|{}property[0]
|
||||
visibility/PublicClassInternalPAMembers|null[0]
|
||||
visibility/PublicClassPrivateMembers|null[0]
|
||||
visibility/PublicClassProtectedMembers.<init>|<init>(kotlin.String){}[0]
|
||||
visibility/PublicClassProtectedMembers.NestedClass.<init>|<init>(){}[0]
|
||||
visibility/PublicClassProtectedMembers.NestedClass|null[0]
|
||||
visibility/PublicClassProtectedMembers.function|function(){}[0]
|
||||
visibility/PublicClassProtectedMembers.property.<get-property>|<get-property>(){}[0]
|
||||
visibility/PublicClassProtectedMembers.property|{}property[0]
|
||||
visibility/PublicClassProtectedMembers|null[0]
|
||||
visibility/PublicClass|null[0]
|
||||
visibility/PublicOpenClassProtectedMembers.<init>|<init>(kotlin.String){}[0]
|
||||
visibility/PublicOpenClassProtectedMembers.NestedClass.<init>|<init>(){}[0]
|
||||
visibility/PublicOpenClassProtectedMembers.NestedClass|null[0]
|
||||
visibility/PublicOpenClassProtectedMembers.function|function(){}[0]
|
||||
visibility/PublicOpenClassProtectedMembers.property.<get-property>|<get-property>(){}[0]
|
||||
visibility/PublicOpenClassProtectedMembers.property|{}property[0]
|
||||
visibility/PublicOpenClassProtectedMembers|null[0]
|
||||
visibility/PublicTypeAlias|null[0]
|
||||
visibility/internalFun|internalFun(){}[0]
|
||||
visibility/internalPAFun|internalPAFun(){}[0]
|
||||
visibility/internalPAVal.<get-internalPAVal>|<get-internalPAVal>(){}[0]
|
||||
visibility/internalPAVal|{}internalPAVal[0]
|
||||
visibility/internalPAVarInternalSetter.<get-internalPAVarInternalSetter>|<get-internalPAVarInternalSetter>(){}[0]
|
||||
visibility/internalPAVarInternalSetter.<set-internalPAVarInternalSetter>|<set-internalPAVarInternalSetter>(kotlin.String){}[0]
|
||||
visibility/internalPAVarInternalSetter|{}internalPAVarInternalSetter[0]
|
||||
visibility/internalPAVarPrivateSetter.<get-internalPAVarPrivateSetter>|<get-internalPAVarPrivateSetter>(){}[0]
|
||||
visibility/internalPAVarPrivateSetter|{}internalPAVarPrivateSetter[0]
|
||||
visibility/internalVal.<get-internalVal>|<get-internalVal>(){}[0]
|
||||
visibility/internalVal|{}internalVal[0]
|
||||
visibility/internalVar.<get-internalVar>|<get-internalVar>(){}[0]
|
||||
visibility/internalVar.<set-internalVar>|<set-internalVar>(kotlin.String){}[0]
|
||||
visibility/internalVar|{}internalVar[0]
|
||||
visibility/publicFun|publicFun(){}[0]
|
||||
visibility/publicVal.<get-publicVal>|<get-publicVal>(){}[0]
|
||||
visibility/publicVal|{}publicVal[0]
|
||||
visibility/publicVarInternalSetter.<get-publicVarInternalSetter>|<get-publicVarInternalSetter>(){}[0]
|
||||
visibility/publicVarInternalSetter.<set-publicVarInternalSetter>|<set-publicVarInternalSetter>(kotlin.String){}[0]
|
||||
visibility/publicVarInternalSetter|{}publicVarInternalSetter[0]
|
||||
visibility/publicVarPrivateSetter.<get-publicVarPrivateSetter>|<get-publicVarPrivateSetter>(){}[0]
|
||||
visibility/publicVarPrivateSetter|{}publicVarPrivateSetter[0]
|
||||
visibility/publicVarPublicSetter.<get-publicVarPublicSetter>|<get-publicVarPublicSetter>(){}[0]
|
||||
visibility/publicVarPublicSetter.<set-publicVarPublicSetter>|<set-publicVarPublicSetter>(kotlin.String){}[0]
|
||||
visibility/publicVarPublicSetter|{}publicVarPublicSetter[0]
|
||||
|
||||
// Imported signatures: 6
|
||||
kotlin/Any.<init>|<init>(){}[0]
|
||||
kotlin/Any|null[0]
|
||||
kotlin/Nothing|null[0]
|
||||
kotlin/PublishedApi.<init>|<init>(){}[0]
|
||||
kotlin/String|null[0]
|
||||
kotlin/Unit|null[0]
|
||||
@@ -0,0 +1,79 @@
|
||||
// FIR_IDENTICAL
|
||||
|
||||
package visibility
|
||||
|
||||
public fun publicFun(): String = ""
|
||||
internal fun internalFun(): String = ""
|
||||
@PublishedApi internal fun internalPAFun(): String = ""
|
||||
private fun privateFun(): String = ""
|
||||
|
||||
public val publicVal: String get() = ""
|
||||
internal val internalVal: String get() = ""
|
||||
@PublishedApi internal val internalPAVal: String get() = ""
|
||||
private val privateVal: String get() = ""
|
||||
|
||||
public var publicVarPublicSetter: String get() = ""
|
||||
set(_) = Unit
|
||||
public var publicVarInternalSetter: String get() = ""
|
||||
internal set(_) = Unit
|
||||
public var publicVarPrivateSetter: String get() = ""
|
||||
private set(_) = Unit
|
||||
internal var internalVar: String get() = ""
|
||||
set(_) = Unit
|
||||
@PublishedApi internal var internalPAVarInternalSetter: String get() = ""
|
||||
set(_) = Unit
|
||||
@PublishedApi internal var internalPAVarPrivateSetter: String get() = ""
|
||||
private set(_) = Unit
|
||||
|
||||
public class PublicClass(val property: String) {
|
||||
fun function(): String = ""
|
||||
class NestedClass
|
||||
}
|
||||
public class PublicClassProtectedMembers protected constructor(protected val property: String) {
|
||||
protected fun function(): String = ""
|
||||
protected class NestedClass
|
||||
}
|
||||
public abstract class PublicAbstractClassProtectedMembers protected constructor(protected val property: String) {
|
||||
protected fun function(): String = ""
|
||||
protected class NestedClass
|
||||
}
|
||||
public open class PublicOpenClassProtectedMembers protected constructor(protected val property: String) {
|
||||
protected fun function(): String = ""
|
||||
protected class NestedClass
|
||||
}
|
||||
public class PublicClassInternalMembers internal constructor(internal val property: String) {
|
||||
internal fun function(): String = ""
|
||||
internal class NestedClass
|
||||
}
|
||||
public class PublicClassInternalPAMembers @PublishedApi internal constructor(@PublishedApi internal val property: String) {
|
||||
@PublishedApi internal fun function(): String = ""
|
||||
@PublishedApi internal class NestedClass
|
||||
}
|
||||
public class PublicClassPrivateMembers private constructor(private val property: String) {
|
||||
private fun function(): String = ""
|
||||
private class NestedClass
|
||||
}
|
||||
internal class InternalClass(val property: String) {
|
||||
fun function(): String = ""
|
||||
class NestedClass
|
||||
}
|
||||
@PublishedApi internal class InternalPAClass(val property: String) {
|
||||
fun function(): String = ""
|
||||
class NestedClass
|
||||
}
|
||||
@PublishedApi internal class InternalPAClassInternalMembers internal constructor(internal val property: String) {
|
||||
internal fun function(): String = ""
|
||||
internal class NestedClass
|
||||
}
|
||||
@PublishedApi internal class InternalPAClassInternalPAMembers @PublishedApi internal constructor(@PublishedApi internal val property: String) {
|
||||
@PublishedApi internal fun function(): String = ""
|
||||
@PublishedApi internal class NestedClass
|
||||
}
|
||||
private class PrivateClass(val property: String) {
|
||||
fun function(): String = ""
|
||||
class NestedClass
|
||||
}
|
||||
|
||||
public typealias PublicTypeAlias = String
|
||||
internal typealias InternalTypeAlias = String
|
||||
private typealias PrivateTypeAlias = String
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.konan.test.blackbox;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||
import org.junit.jupiter.api.Tag;
|
||||
import org.jetbrains.kotlin.konan.test.blackbox.support.group.FirPipeline;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.GenerateNativeTestsKt}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("native/native.tests/testData/klib/dump-signatures")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@Tag("frontend-fir")
|
||||
@FirPipeline()
|
||||
public class FirNativeKlibDumpIrSignaturesTestGenerated extends AbstractNativeKlibDumpIrSignaturesTest {
|
||||
@Test
|
||||
public void testAllFilesPresentInDump_signatures() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("native/native.tests/testData/klib/dump-signatures"), Pattern.compile("^([^_](.+)).kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("callables.kt")
|
||||
public void testCallables() throws Exception {
|
||||
runTest("native/native.tests/testData/klib/dump-signatures/callables.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("imported_declarations.kt")
|
||||
public void testImported_declarations() throws Exception {
|
||||
runTest("native/native.tests/testData/klib/dump-signatures/imported_declarations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("imported_from_cinterop.kt")
|
||||
public void testImported_from_cinterop() throws Exception {
|
||||
runTest("native/native.tests/testData/klib/dump-signatures/imported_from_cinterop.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("type_parameters.kt")
|
||||
public void testType_parameters() throws Exception {
|
||||
runTest("native/native.tests/testData/klib/dump-signatures/type_parameters.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("visibility.kt")
|
||||
public void testVisibility() throws Exception {
|
||||
runTest("native/native.tests/testData/klib/dump-signatures/visibility.kt");
|
||||
}
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.konan.test.blackbox;
|
||||
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.kotlin.test.util.KtTestUtil;
|
||||
import org.jetbrains.kotlin.test.TestMetadata;
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.GenerateNativeTestsKt}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("native/native.tests/testData/klib/dump-signatures")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
public class NativeKlibDumpIrSignaturesTestGenerated extends AbstractNativeKlibDumpIrSignaturesTest {
|
||||
@Test
|
||||
public void testAllFilesPresentInDump_signatures() throws Exception {
|
||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("native/native.tests/testData/klib/dump-signatures"), Pattern.compile("^([^_](.+)).kt$"), null, true);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("callables.kt")
|
||||
public void testCallables() throws Exception {
|
||||
runTest("native/native.tests/testData/klib/dump-signatures/callables.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("imported_declarations.kt")
|
||||
public void testImported_declarations() throws Exception {
|
||||
runTest("native/native.tests/testData/klib/dump-signatures/imported_declarations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("imported_from_cinterop.kt")
|
||||
public void testImported_from_cinterop() throws Exception {
|
||||
runTest("native/native.tests/testData/klib/dump-signatures/imported_from_cinterop.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("type_parameters.kt")
|
||||
public void testType_parameters() throws Exception {
|
||||
runTest("native/native.tests/testData/klib/dump-signatures/type_parameters.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("visibility.kt")
|
||||
public void testVisibility() throws Exception {
|
||||
runTest("native/native.tests/testData/klib/dump-signatures/visibility.kt");
|
||||
}
|
||||
}
|
||||
+19
@@ -240,6 +240,25 @@ fun main() {
|
||||
}
|
||||
}
|
||||
|
||||
// Dump KLIB IR signatures tests
|
||||
testGroup("native/native.tests/tests-gen", "native/native.tests/testData") {
|
||||
testClass<AbstractNativeKlibDumpIrSignaturesTest>(
|
||||
suiteTestClassName = "NativeKlibDumpIrSignaturesTestGenerated",
|
||||
) {
|
||||
model("klib/dump-signatures", pattern = "^([^_](.+)).kt$", recursive = true)
|
||||
}
|
||||
}
|
||||
testGroup("native/native.tests/tests-gen", "native/native.tests/testData") {
|
||||
testClass<AbstractNativeKlibDumpIrSignaturesTest>(
|
||||
suiteTestClassName = "FirNativeKlibDumpIrSignaturesTestGenerated",
|
||||
annotations = listOf(
|
||||
*frontendFir()
|
||||
)
|
||||
) {
|
||||
model("klib/dump-signatures", pattern = "^([^_](.+)).kt$", recursive = true)
|
||||
}
|
||||
}
|
||||
|
||||
// LLDB integration tests.
|
||||
testGroup("native/native.tests/tests-gen", "native/native.tests/testData") {
|
||||
testClass<AbstractNativeBlackBoxTest>(
|
||||
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.konan.test.blackbox
|
||||
|
||||
import com.intellij.testFramework.TestDataFile
|
||||
import org.jetbrains.kotlin.konan.test.blackbox.support.*
|
||||
import org.jetbrains.kotlin.konan.test.blackbox.support.compilation.TestCompilationArtifact
|
||||
import org.jetbrains.kotlin.konan.test.blackbox.support.compilation.TestCompilationDependency
|
||||
import org.jetbrains.kotlin.konan.test.blackbox.support.compilation.TestCompilationResult.Companion.assertSuccess
|
||||
import org.jetbrains.kotlin.konan.test.blackbox.support.runner.TestRunChecks
|
||||
import org.jetbrains.kotlin.konan.test.blackbox.support.settings.KotlinNativeClassLoader
|
||||
import org.jetbrains.kotlin.konan.test.blackbox.support.settings.PipelineType
|
||||
import org.jetbrains.kotlin.konan.test.blackbox.support.settings.Timeouts
|
||||
import org.jetbrains.kotlin.konan.test.blackbox.support.util.getAbsoluteFile
|
||||
import org.jetbrains.kotlin.konan.test.blackbox.support.util.dumpIrSignatures
|
||||
import org.jetbrains.kotlin.library.KotlinIrSignatureVersion
|
||||
import org.jetbrains.kotlin.test.services.JUnit5Assertions.assertEqualsToFile
|
||||
import org.jetbrains.kotlin.test.utils.withExtension
|
||||
import org.junit.jupiter.api.Assertions.assertTrue
|
||||
import org.junit.jupiter.api.Tag
|
||||
import java.io.File
|
||||
|
||||
@Tag("klib")
|
||||
abstract class AbstractNativeKlibDumpIrSignaturesTest : AbstractNativeSimpleTest() {
|
||||
protected fun runTest(@TestDataFile testDataPath: String) {
|
||||
val testDataFile = getAbsoluteFile(testDataPath)
|
||||
muteTestIfNecessary(testDataFile)
|
||||
|
||||
val dependencies: List<TestCompilationDependency<TestCompilationArtifact.KLIB>> = buildList {
|
||||
this += compileRegularDependencies(testDataFile)
|
||||
this += compileInteropDependencies(testDataFile)
|
||||
}
|
||||
|
||||
val library = compileSingleFileToLibrary(testDataFile, dependencies)
|
||||
|
||||
val testPathNoExtension = testDataFile.canonicalPath.substringBeforeLast(".")
|
||||
|
||||
val firSpecificExt =
|
||||
if (testRunSettings.get<PipelineType>() == PipelineType.K2 && !firIdentical(testDataFile))
|
||||
".fir"
|
||||
else ""
|
||||
|
||||
KotlinIrSignatureVersion.CURRENTLY_SUPPORTED_VERSIONS.forEach { signatureVersion ->
|
||||
val expectedContents = File("$testPathNoExtension$firSpecificExt.ir-signatures.v${signatureVersion.number}.txt")
|
||||
assertSignaturesMatchExpected(library, expectedContents, signatureVersion)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private fun assertSignaturesMatchExpected(
|
||||
library: TestCompilationArtifact.KLIB,
|
||||
expectedContents: File,
|
||||
signatureVersion: KotlinIrSignatureVersion
|
||||
) {
|
||||
val kotlinNativeClassLoader = testRunSettings.get<KotlinNativeClassLoader>()
|
||||
val dumpedSignatures = library.dumpIrSignatures(kotlinNativeClassLoader.classLoader, signatureVersion)
|
||||
assertEqualsToFile(expectedContents, dumpedSignatures)
|
||||
}
|
||||
|
||||
private fun compileInteropDependencies(testDataFile: File): List<TestCompilationDependency<TestCompilationArtifact.KLIB>> {
|
||||
val defFile = testDataFile.withExtension(".lib.def")
|
||||
if (!defFile.exists()) return emptyList()
|
||||
|
||||
assertTrue(defFile.isFile) { "Def file does not exist: $defFile" }
|
||||
|
||||
return listOf(
|
||||
cinteropToLibrary(
|
||||
targets = targets,
|
||||
defFile = defFile,
|
||||
outputDir = buildDir,
|
||||
freeCompilerArgs = TestCompilerArgs.EMPTY
|
||||
).assertSuccess().resultingArtifact.asLibraryDependency()
|
||||
)
|
||||
}
|
||||
|
||||
private fun compileRegularDependencies(testDataFile: File): List<TestCompilationDependency<TestCompilationArtifact.KLIB>> {
|
||||
val mainSourceFileName = testDataFile.name
|
||||
|
||||
return testDataFile.parentFile.listFiles().orEmpty().mapNotNull { dependencyTestDataFile ->
|
||||
if (dependencyTestDataFile == testDataFile || !dependencyTestDataFile.isFile) return@mapNotNull null
|
||||
val dependencyTestDataFileName = dependencyTestDataFile.name
|
||||
|
||||
val dependencyName = dependencyTestDataFileName.substringAfter(mainSourceFileName + "_", missingDelimiterValue = "")
|
||||
if (dependencyName.isBlank()) return@mapNotNull null
|
||||
|
||||
val dependencySourceFile = dependencyTestDataFile.copyTo(buildDir.resolve("$dependencyName.kt"))
|
||||
compileSingleFileToLibrary(dependencySourceFile, emptyList()).asLibraryDependency()
|
||||
}
|
||||
}
|
||||
|
||||
private fun compileSingleFileToLibrary(
|
||||
sourceFile: File,
|
||||
dependencies: List<TestCompilationDependency<TestCompilationArtifact.KLIB>>,
|
||||
): TestCompilationArtifact.KLIB {
|
||||
val moduleName: String = sourceFile.nameWithoutExtension
|
||||
val module = TestModule.Exclusive(moduleName, emptySet(), emptySet(), emptySet())
|
||||
module.files += TestFile.createCommitted(sourceFile, module)
|
||||
|
||||
val testCase = TestCase(
|
||||
id = TestCaseId.Named(moduleName),
|
||||
kind = TestKind.STANDALONE,
|
||||
modules = setOf(module),
|
||||
freeCompilerArgs = TestCompilerArgs("-Xklib-relative-path-base=${sourceFile.parent}"),
|
||||
nominalPackageName = PackageName.EMPTY,
|
||||
checks = TestRunChecks.Default(testRunSettings.get<Timeouts>().executionTimeout),
|
||||
extras = TestCase.WithTestRunnerExtras(TestRunnerType.DEFAULT)
|
||||
).apply {
|
||||
initialize(null, null)
|
||||
}
|
||||
|
||||
return compileToLibrary(testCase, *dependencies.toTypedArray()).assertSuccess().resultingArtifact
|
||||
}
|
||||
}
|
||||
+19
-3
@@ -6,13 +6,13 @@
|
||||
package org.jetbrains.kotlin.konan.test.blackbox.support.util
|
||||
|
||||
import org.jetbrains.kotlin.konan.test.blackbox.support.compilation.TestCompilationArtifact
|
||||
import org.jetbrains.kotlin.library.KotlinIrSignatureVersion
|
||||
import java.io.File
|
||||
|
||||
private fun invokeKlibTool(kotlinNativeClassLoader: ClassLoader, klibFile: File, functionName: String, vararg args: Any): String {
|
||||
private fun invokeKlibTool(kotlinNativeClassLoader: ClassLoader, klibFile: File, functionName: String, vararg args: Any?): String {
|
||||
val libraryClass = Class.forName("org.jetbrains.kotlin.cli.klib.Library", true, kotlinNativeClassLoader)
|
||||
val entryPoint = libraryClass.declaredMethods.single { it.name == functionName }
|
||||
val lib = libraryClass.getDeclaredConstructor(String::class.java, String::class.java)
|
||||
.newInstance(klibFile.canonicalPath, null)
|
||||
val lib = libraryClass.getDeclaredConstructor(String::class.java, String::class.java).newInstance(klibFile.canonicalPath, null)
|
||||
|
||||
val output = StringBuilder()
|
||||
entryPoint.invoke(lib, output, *args)
|
||||
@@ -30,3 +30,19 @@ internal fun TestCompilationArtifact.KLIB.dumpIr(
|
||||
): String {
|
||||
return invokeKlibTool(kotlinNativeClassLoader, klibFile, "dumpIr", printSignatures)
|
||||
}
|
||||
|
||||
internal fun TestCompilationArtifact.KLIB.dumpIrSignatures(
|
||||
kotlinNativeClassLoader: ClassLoader,
|
||||
signatureVersion: KotlinIrSignatureVersion,
|
||||
): String {
|
||||
// This ceremony is required to load `KotlinIrSignatureVersion` class from the isolated class loader and thus avoid
|
||||
// "argument type mismatch" exception raised by the Java reflection API.
|
||||
// TODO: migrate on CLI-based scheme of invocation of all KLIB tool commands
|
||||
val signatureVersionForIsolatedClassLoader = Class.forName(
|
||||
signatureVersion::class.java.canonicalName,
|
||||
true,
|
||||
kotlinNativeClassLoader
|
||||
).getDeclaredConstructor(Int::class.java).newInstance(signatureVersion.number)!!
|
||||
|
||||
return invokeKlibTool(kotlinNativeClassLoader, klibFile, "dumpIrSignatures", signatureVersionForIsolatedClassLoader)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user