Create actual: put top-level actual declarations in the same file

When multiple expect declarations are in the same file,
and some of them already have actual declarations for this platform,
then "Create actual fix" put other declarations into the same file
with existing actual declarations

So #KT-17058 Fixed
So #KT-21082 Fixed
This commit is contained in:
Mikhail Glukhikh
2018-03-02 15:37:59 +03:00
parent 3ec2dac10b
commit 90e4413fc9
11 changed files with 83 additions and 13 deletions
@@ -0,0 +1,5 @@
// "Create actual function for platform JVM" "true"
expect fun bar()
expect fun <caret>foo(arg: Int): String
@@ -0,0 +1,5 @@
// "Create actual function for platform JVM" "true"
expect fun bar()
expect fun foo(arg: Int): String
@@ -0,0 +1,3 @@
// foo: to be implemented
actual fun bar() {}
@@ -0,0 +1,6 @@
// foo: to be implemented
actual fun bar() {}
actual fun foo(arg: Int): String {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@@ -0,0 +1,7 @@
// "Create actual class for platform JS" "true"
expect sealed class Sealed
expect object Obj : Sealed
expect class <caret>Klass(x: Int) : Sealed
@@ -0,0 +1,7 @@
// "Create actual class for platform JS" "true"
expect sealed class Sealed
expect object Obj : Sealed
expect class Klass(x: Int) : Sealed
@@ -0,0 +1,5 @@
// Sealed: to be implemented
actual sealed class Sealed
actual object Obj : Sealed()
@@ -0,0 +1,6 @@
// Sealed: to be implemented
actual sealed class Sealed
actual object Obj : Sealed()
actual class Klass actual constructor(x: Int) : Sealed