Add a set of new tests for KT-27075 (create expected class) + some fixes

This commit is contained in:
Mikhail Glukhikh
2018-11-20 13:48:48 +03:00
parent 4ab4358d22
commit f31428257d
37 changed files with 400 additions and 34 deletions
@@ -0,0 +1,4 @@
// My: to be implemented
// DISABLE-ERRORS
annotation class CommonAnnotation
@@ -0,0 +1,10 @@
// My: to be implemented
// DISABLE-ERRORS
annotation class CommonAnnotation
expect class My {
tailrec fun foo(arg: Int): Int
var some: Boolean
fun initialize()
}
@@ -0,0 +1,20 @@
// "Create expected class in common module testModule_Common" "true"
// DISABLE-ERRORS
annotation class PlatformAnnotation
actual class <caret>My {
@PlatformAnnotation
actual tailrec fun foo(arg: Int): Int {
if (arg <= 1) return 1
return foo(arg - 1)
}
// Here we will have an error (lateinit is not supported on both sides)
actual lateinit var some: Boolean
@CommonAnnotation
actual fun initialize() {
some = true
}
}
@@ -0,0 +1,20 @@
// "Create expected class in common module testModule_Common" "true"
// DISABLE-ERRORS
annotation class PlatformAnnotation
actual class <caret>My {
@PlatformAnnotation
actual tailrec fun foo(arg: Int): Int {
if (arg <= 1) return 1
return foo(arg - 1)
}
// Here we will have an error (lateinit is not supported on both sides)
actual lateinit var some: Boolean
@CommonAnnotation
actual fun initialize() {
some = true
}
}