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,2 @@
// My: to be implemented
// DISABLE-ERRORS
@@ -0,0 +1,24 @@
// My: to be implemented
// DISABLE-ERRORS
/**
* Dokka comment: class to be created as expect
*/
expect class My {
fun foo(param: String): Int
fun String.bar(y: Double): Boolean
/**
* Dokka comment: Just does nothing
*/
fun baz()
/**
* Dokka comment: Just does nothing
*
* @flag this parameter is just ignored
*/
constructor(flag: Boolean)
val isGood: Boolean
var status: Int
}
@@ -0,0 +1,35 @@
// "Create expected class in common module testModule_Common" "true"
// DISABLE-ERRORS
/**
* Dokka comment: class to be created as expect
*/
actual class <caret>My {
// Helpful function
actual fun foo(param: String): Int = 42
/* Very helpful extension */
actual fun String.bar(y: Double): Boolean = true
/**
* Dokka comment: Just does nothing
*/
actual fun baz() {}
/**
* Dokka comment: Just does nothing
*
* @flag this parameter is just ignored
*/
actual constructor(flag: Boolean) {}
// Some immutable property
actual val isGood: Boolean
get() = true
/* Interesting mutable property */
actual var status: Int
get() = 0
set(value) {}
}
@@ -0,0 +1,35 @@
// "Create expected class in common module testModule_Common" "true"
// DISABLE-ERRORS
/**
* Dokka comment: class to be created as expect
*/
actual class <caret>My {
// Helpful function
actual fun foo(param: String): Int = 42
/* Very helpful extension */
actual fun String.bar(y: Double): Boolean = true
/**
* Dokka comment: Just does nothing
*/
actual fun baz() {}
/**
* Dokka comment: Just does nothing
*
* @flag this parameter is just ignored
*/
actual constructor(flag: Boolean) {}
// Some immutable property
actual val isGood: Boolean
get() = true
/* Interesting mutable property */
actual var status: Int
get() = 0
set(value) {}
}