CreateExpect: shouldn't generate expect declaration from actual function with private, lateinit or const
#KT-33930 Fixed
This commit is contained in:
+1
@@ -0,0 +1 @@
|
||||
// DISABLE-ERRORS
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// "Create expected function in common module testModule_Common" "true"
|
||||
// SHOULD_FAIL_WITH: "The declaration has `private` modifier"
|
||||
// DISABLE-ERRORS
|
||||
|
||||
private actual fun <caret>s() = "s"
|
||||
+1
@@ -0,0 +1 @@
|
||||
// DISABLE-ERRORS
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// "Create expected property in common module testModule_Common" "true"
|
||||
// SHOULD_FAIL_WITH: "The declaration has `const` modifier"
|
||||
// DISABLE-ERRORS
|
||||
|
||||
actual const val <caret>s: String = "Hello"
|
||||
+1
@@ -0,0 +1 @@
|
||||
// DISABLE-ERRORS
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// "Create expected property in common module testModule_Common" "true"
|
||||
// SHOULD_FAIL_WITH: "The declaration has `lateinit` modifier"
|
||||
// DISABLE-ERRORS
|
||||
|
||||
actual lateinit var <caret>s: String
|
||||
+1
@@ -0,0 +1 @@
|
||||
// DISABLE-ERRORS
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// "Create expected property in common module testModule_Common" "true"
|
||||
// SHOULD_FAIL_WITH: "The declaration has `private` modifier"
|
||||
// DISABLE-ERRORS
|
||||
|
||||
private actual val <caret>s: String = "s"
|
||||
-1
@@ -4,7 +4,6 @@
|
||||
annotation class CommonAnnotation
|
||||
expect class My {
|
||||
tailrec fun foo(arg: Int): Int
|
||||
var some: Boolean
|
||||
@CommonAnnotation
|
||||
fun initialize()
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ actual class <caret>My {
|
||||
}
|
||||
|
||||
// Here we will have an error (lateinit is not supported on both sides)
|
||||
actual lateinit var some: Boolean
|
||||
lateinit var some: Boolean
|
||||
|
||||
@CommonAnnotation
|
||||
actual fun initialize() {
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
These declarations cannot be transformed:
|
||||
actual lateinit var some: Boolean
|
||||
Reference in New Issue
Block a user