-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestDeclarations.kt
84 lines (70 loc) · 1.77 KB
/
TestDeclarations.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package tester.second
import com.rnett.plugin.export.annotations.PluginExport
import kotlin.reflect.KClass
//TODO better commonizer tests: expect class w/ additional methods on some platforms
// nesting like class being native only, method on one native
//@PluginExport
//expect fun testExpectFun(): String
//
//expect fun testActualFun(): String
@PluginExport
annotation class TestAnnotation(
val t: Int = 2,
val s: String = testConst,
val e: TestEnum = TestEnum.Two,
val c: KClass<*> = TestClass::class,
val r: ExportedAnnotation = ExportedAnnotation(2),
val n: NonExported = NonExported("test"),
val a: IntArray = [1, 2, 3],
)
@PluginExport
annotation class ExportedAnnotation(val i: Int)
annotation class NonExported(val s: String)
@PluginExport
enum class TestEnum {
One, Two, Three;
@PluginExport
val testProp: String = "test"
}
//@PluginExport
//fun testIsOne(t: TestEnum) = t == TestEnum.One
@PluginExport
const val testConst: String = "test"
@PluginExport
class TestClass @PluginExport constructor(@PluginExport var n: Int) {
@PluginExport("fromString")
constructor(s: String) : this(s.toInt())
@PluginExport
class NestedClass {
}
}
//@PluginExport
//class WithTypeParams<T : Number> @PluginExport constructor(val n: T) {
//}
//
//@PluginExport
//typealias TestTypealias = IllegalStateException
//
//@PluginExport
//typealias TestTypealiasWithArg<T> = List<T>
//
//@PluginExport
//fun <T> Int.testTopLevelFunction(req: T, opt: Double? = 2.0, vararg t: String): Int {
// return 2
//}
//
//@PluginExport
//@PublishedApi
//internal fun testPublishedApi() {
//
//}
//
//@PluginExport
//@PublishedApi
//internal fun testPublishedApi(t: Int) {
//
//}
//
//@PluginExport
//val <T : Number> T.testPropWithTypeVar
// get() = toInt()