Migrate boxInline tests to new multi-file framework
This commit is contained in:
committed by
Alexander Udalov
parent
fa1f7d988e
commit
cc84aabdcf
@@ -1,12 +0,0 @@
|
||||
package test
|
||||
|
||||
interface F<T> {
|
||||
fun test(p: T) : Int
|
||||
}
|
||||
|
||||
inline fun <T: Any?> Array<T>.copyOfRange1(crossinline toIndex: () -> Int) =
|
||||
object : F<T> {
|
||||
override fun test(p: T): Int {
|
||||
return toIndex()
|
||||
}
|
||||
}
|
||||
+18
-1
@@ -1,3 +1,20 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
interface F<T> {
|
||||
fun test(p: T) : Int
|
||||
}
|
||||
|
||||
inline fun <T: Any?> Array<T>.copyOfRange1(crossinline toIndex: () -> Int) =
|
||||
object : F<T> {
|
||||
override fun test(p: T): Int {
|
||||
return toIndex()
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
import test.*
|
||||
@@ -14,4 +31,4 @@ fun box(): String {
|
||||
if (name != "java.lang.Object") return "fail 2: ${name}"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package test
|
||||
|
||||
interface F<T> {
|
||||
fun test(p: T) : Int
|
||||
}
|
||||
|
||||
inline fun <T> Array<T>.copyOfRange1(crossinline toIndex: () -> Int) =
|
||||
object : F<T> {
|
||||
override fun test(p: T): Int {
|
||||
return toIndex()
|
||||
}
|
||||
}
|
||||
+18
-1
@@ -1,3 +1,20 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
interface F<T> {
|
||||
fun test(p: T) : Int
|
||||
}
|
||||
|
||||
inline fun <T> Array<T>.copyOfRange1(crossinline toIndex: () -> Int) =
|
||||
object : F<T> {
|
||||
override fun test(p: T): Int {
|
||||
return toIndex()
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
import test.*
|
||||
@@ -14,4 +31,4 @@ fun box(): String {
|
||||
if (name != "java.lang.CharSequence") return "fail 2: ${name}"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
package test
|
||||
|
||||
|
||||
inline fun stub() {
|
||||
|
||||
}
|
||||
+11
-1
@@ -1,3 +1,14 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
|
||||
inline fun stub() {
|
||||
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
import test.*
|
||||
@@ -15,4 +26,3 @@ fun box(): String {
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
package test
|
||||
|
||||
class B<T>
|
||||
|
||||
interface A {
|
||||
fun <T> aTest(p: T): B<T>
|
||||
}
|
||||
|
||||
open class Test {
|
||||
|
||||
inline fun <T> test(crossinline z: () -> Int) = object : A {
|
||||
override fun <T> aTest(p: T): B<T> {
|
||||
z()
|
||||
return B<T>()
|
||||
}
|
||||
}
|
||||
|
||||
fun callInline() = test<String> { 1 }
|
||||
}
|
||||
+24
@@ -1,3 +1,27 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class B<T>
|
||||
|
||||
interface A {
|
||||
fun <T> aTest(p: T): B<T>
|
||||
}
|
||||
|
||||
open class Test {
|
||||
|
||||
inline fun <T> test(crossinline z: () -> Int) = object : A {
|
||||
override fun <T> aTest(p: T): B<T> {
|
||||
z()
|
||||
return B<T>()
|
||||
}
|
||||
}
|
||||
|
||||
fun callInline() = test<String> { 1 }
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
// FULL_JDK
|
||||
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
package test
|
||||
|
||||
class B<T>
|
||||
|
||||
interface A {
|
||||
fun <T> aTest(p: T): B<T>
|
||||
}
|
||||
|
||||
open class Test {
|
||||
|
||||
inline fun <reified T> test(crossinline z: () -> Int) = object : A {
|
||||
override fun <T> aTest(p: T): B<T> {
|
||||
z()
|
||||
return B<T>()
|
||||
}
|
||||
}
|
||||
|
||||
fun callInline() = test<String> { 1 }
|
||||
}
|
||||
+24
@@ -1,3 +1,27 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
class B<T>
|
||||
|
||||
interface A {
|
||||
fun <T> aTest(p: T): B<T>
|
||||
}
|
||||
|
||||
open class Test {
|
||||
|
||||
inline fun <reified T> test(crossinline z: () -> Int) = object : A {
|
||||
override fun <T> aTest(p: T): B<T> {
|
||||
z()
|
||||
return B<T>()
|
||||
}
|
||||
}
|
||||
|
||||
fun callInline() = test<String> { 1 }
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
// FULL_JDK
|
||||
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
package test
|
||||
|
||||
interface F<T> {
|
||||
fun test(p: T) : Int
|
||||
}
|
||||
|
||||
inline fun <T> Array<T>.copyOfRange1(crossinline toIndex: () -> Int) =
|
||||
object : F<T> {
|
||||
override fun test(p: T): Int {
|
||||
return toIndex()
|
||||
}
|
||||
}
|
||||
+18
-1
@@ -1,3 +1,20 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
interface F<T> {
|
||||
fun test(p: T) : Int
|
||||
}
|
||||
|
||||
inline fun <T> Array<T>.copyOfRange1(crossinline toIndex: () -> Int) =
|
||||
object : F<T> {
|
||||
override fun test(p: T): Int {
|
||||
return toIndex()
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
import test.*
|
||||
@@ -14,4 +31,4 @@ fun box(): String {
|
||||
if (name != "java.lang.Object") return "fail 2: ${name}"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
package test
|
||||
|
||||
open class Test {
|
||||
|
||||
inline fun <Y> test(z: () -> () -> Y) = z()
|
||||
|
||||
fun <T> callInline(p: T) = test<T> {
|
||||
{
|
||||
p
|
||||
}
|
||||
}
|
||||
}
|
||||
+17
@@ -1,3 +1,20 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
open class Test {
|
||||
|
||||
inline fun <Y> test(z: () -> () -> Y) = z()
|
||||
|
||||
fun <T> callInline(p: T) = test<T> {
|
||||
{
|
||||
p
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
// FULL_JDK
|
||||
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
package test
|
||||
|
||||
import java.util.*
|
||||
|
||||
open class CustomerService {
|
||||
|
||||
fun <T> comparator() = object : Comparator<T> {
|
||||
override fun compare(o1: T, o2: T): Int {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
}
|
||||
|
||||
inline fun <T> comparator(crossinline z: () -> Int) = object : Comparator<T> {
|
||||
|
||||
override fun compare(o1: T, o2: T): Int {
|
||||
return z()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun callInline() = comparator<String> { 1 }
|
||||
|
||||
}
|
||||
|
||||
+29
-1
@@ -1,3 +1,31 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
import java.util.*
|
||||
|
||||
open class CustomerService {
|
||||
|
||||
fun <T> comparator() = object : Comparator<T> {
|
||||
override fun compare(o1: T, o2: T): Int {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
}
|
||||
|
||||
inline fun <T> comparator(crossinline z: () -> Int) = object : Comparator<T> {
|
||||
|
||||
override fun compare(o1: T, o2: T): Int {
|
||||
return z()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun callInline() = comparator<String> { 1 }
|
||||
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
import test.*
|
||||
@@ -23,4 +51,4 @@ fun box(): String {
|
||||
if (name != "java.lang.String") return "fail 6: ${name}"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
-25
@@ -1,25 +0,0 @@
|
||||
package test
|
||||
|
||||
interface MComparator<T> {
|
||||
fun compare(o1: T, o2: T): Int
|
||||
}
|
||||
|
||||
open class CustomerService {
|
||||
|
||||
fun <T> comparator() = object : MComparator<T> {
|
||||
override fun compare(o1: T, o2: T): Int {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
}
|
||||
|
||||
inline fun <T> comparator(crossinline z: () -> Int) = object : MComparator<T> {
|
||||
|
||||
override fun compare(o1: T, o2: T): Int {
|
||||
return z()
|
||||
}
|
||||
}
|
||||
|
||||
fun callInline() = comparator<String> { 1 }
|
||||
|
||||
}
|
||||
|
||||
+30
-1
@@ -1,3 +1,32 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
interface MComparator<T> {
|
||||
fun compare(o1: T, o2: T): Int
|
||||
}
|
||||
|
||||
open class CustomerService {
|
||||
|
||||
fun <T> comparator() = object : MComparator<T> {
|
||||
override fun compare(o1: T, o2: T): Int {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
}
|
||||
|
||||
inline fun <T> comparator(crossinline z: () -> Int) = object : MComparator<T> {
|
||||
|
||||
override fun compare(o1: T, o2: T): Int {
|
||||
return z()
|
||||
}
|
||||
}
|
||||
|
||||
fun callInline() = comparator<String> { 1 }
|
||||
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
//NO_CHECK_LAMBDA_INLINING
|
||||
import test.*
|
||||
|
||||
@@ -22,4 +51,4 @@ fun box(): String {
|
||||
if (name != "java.lang.String") return "fail 6: ${name}"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user