Add platformStatic annotation to main method from java
#KT-8219 Fixed
This commit is contained in:
+4
-4
@@ -1,4 +1,6 @@
|
||||
// ERROR: Property must be initialized or be abstract
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
public class Identifier<T> {
|
||||
public val name: T
|
||||
private val myHasDollar: Boolean
|
||||
@@ -21,11 +23,9 @@ public class Identifier<T> {
|
||||
}
|
||||
|
||||
public object User {
|
||||
public fun main(args: Array<String>) {
|
||||
platformStatic public fun main(args: Array<String>) {
|
||||
val i1 = Identifier("name", false, true)
|
||||
val i2 = Identifier("name", false)
|
||||
val i3 = Identifier("name")
|
||||
}
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) = User.main(args)
|
||||
}
|
||||
+3
-4
@@ -3,9 +3,10 @@
|
||||
// ERROR: Assignments are not expressions, and only expressions are allowed in this context
|
||||
// ERROR: Unresolved reference: close
|
||||
import java.io.*
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
object FileRead {
|
||||
public fun main(args: Array<String>) {
|
||||
platformStatic public fun main(args: Array<String>) {
|
||||
try {
|
||||
val fstream = FileInputStream()
|
||||
val `in` = DataInputStream(fstream)
|
||||
@@ -20,6 +21,4 @@ object FileRead {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) = FileRead.main(args)
|
||||
}
|
||||
+4
-4
@@ -1,9 +1,9 @@
|
||||
package demo
|
||||
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
object Program {
|
||||
public fun main(args: Array<String>) {
|
||||
platformStatic public fun main(args: Array<String>) {
|
||||
println("Halo!")
|
||||
}
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) = Program.main(args)
|
||||
}
|
||||
Reference in New Issue
Block a user