Move multi-file codegen testData to boxMultiFile/
There'll be an auto-generated test over this directory
This commit is contained in:
committed by
Alexander Udalov
parent
544aad390d
commit
a61b3ec461
@@ -0,0 +1 @@
|
||||
fun box() = a.x
|
||||
@@ -0,0 +1,3 @@
|
||||
package a
|
||||
|
||||
val x: String = "OK"
|
||||
@@ -0,0 +1,18 @@
|
||||
package thispackage
|
||||
|
||||
import otherpackage.*
|
||||
|
||||
fun box(): String {
|
||||
if (!localUse()) {
|
||||
return "local use failed"
|
||||
}
|
||||
if (!fromOtherPackage()) {
|
||||
return "use from other package failed"
|
||||
}
|
||||
return "OK"
|
||||
}
|
||||
|
||||
fun localUse(): Boolean {
|
||||
val c = javaClass<Runnable>()
|
||||
return (c.getName()!! == "java.lang.Runnable")
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package otherpackage
|
||||
|
||||
fun fromOtherPackage(): Boolean {
|
||||
val c = javaClass<Runnable>()
|
||||
return (c.getName()!! == "java.lang.Runnable")
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
fun box() = foo()
|
||||
@@ -0,0 +1,4 @@
|
||||
private val a = "OK"
|
||||
fun foo() : String {
|
||||
return "${a}"
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
public var v1: String = "V1"
|
||||
|
||||
fun box(): String {
|
||||
val s = "v1: $v1, v2: $v2"
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
public var v2: String = "V2"
|
||||
@@ -0,0 +1,12 @@
|
||||
import testing.ClassWithInternals
|
||||
|
||||
public class HelloServer() : ClassWithInternals() {
|
||||
public override fun start() {
|
||||
val test = foo() + someGetter //+ some
|
||||
}
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
HelloServer().start()
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package testing; // There is no error if both files are in default package
|
||||
|
||||
public abstract class ClassWithInternals {
|
||||
protected var some: Int = 0;
|
||||
protected var someGetter: Int = 0
|
||||
get() = 5
|
||||
|
||||
protected fun foo() : Int = 0
|
||||
|
||||
public abstract fun start() : Unit;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun box() = o + k
|
||||
|
||||
private val o = "O"
|
||||
@@ -0,0 +1,3 @@
|
||||
private val k = "K"
|
||||
|
||||
fun ignore() = o
|
||||
@@ -0,0 +1,3 @@
|
||||
package a.b
|
||||
|
||||
fun box() = a.x
|
||||
@@ -0,0 +1,3 @@
|
||||
package a
|
||||
|
||||
private val x: String = "OK"
|
||||
@@ -0,0 +1 @@
|
||||
fun box() = box1() + "K"
|
||||
@@ -0,0 +1 @@
|
||||
fun box1() = "O"
|
||||
@@ -0,0 +1 @@
|
||||
fun box() = ok()
|
||||
@@ -0,0 +1 @@
|
||||
fun ok(res: String = "OK") = res
|
||||
Reference in New Issue
Block a user