Test compilation fix
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import java.util.Enumeration
|
import java.util.Enumeration
|
||||||
|
|
||||||
inline fun <T> java.util.Enumeration<T>.iterator() = object: Iterator<T> {
|
fun <T> java.util.Enumeration<T>.iterator() = object: Iterator<T> {
|
||||||
override fun hasNext(): Boolean = hasMoreElements()
|
override fun hasNext(): Boolean = hasMoreElements()
|
||||||
|
|
||||||
override fun next() = nextElement()
|
override fun next() = nextElement()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import java.util.Enumeration
|
import java.util.Enumeration
|
||||||
|
|
||||||
inline fun <T> java.util.Enumeration<T>.iterator() = object : Iterator<T> {
|
fun <T> java.util.Enumeration<T>.iterator() = object : Iterator<T> {
|
||||||
public override fun hasNext(): Boolean = hasMoreElements()
|
public override fun hasNext(): Boolean = hasMoreElements()
|
||||||
|
|
||||||
public override fun next() = nextElement()
|
public override fun next() = nextElement()
|
||||||
|
|||||||
+1
-1
@@ -6,6 +6,6 @@ fun Array<Int>.toIntArray(): IntArray = this.<!TYPE_INFERENCE_UPPER_BOUND_VIOLAT
|
|||||||
|
|
||||||
fun Array<Int>.toArrayList(): ArrayList<Int> = this.mapTo(ArrayList<Int>(size), {it})
|
fun Array<Int>.toArrayList(): ArrayList<Int> = this.mapTo(ArrayList<Int>(size), {it})
|
||||||
|
|
||||||
public inline fun <T, R, C: MutableCollection<in R>> Array<out T>.mapTo(result: C, transform : (T) -> R) : C =
|
public fun <T, R, C: MutableCollection<in R>> Array<out T>.mapTo(result: C, transform : (T) -> R) : C =
|
||||||
throw Exception("$result $transform")
|
throw Exception("$result $transform")
|
||||||
|
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ class Item(val name: String, val rating: Int): Comparable<Item> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// from standard library
|
// from standard library
|
||||||
inline fun <T : Any> compareBy(<!UNUSED_PARAMETER!>a<!>: T?, <!UNUSED_PARAMETER!>b<!>: T?,
|
fun <T : Any> compareBy(<!UNUSED_PARAMETER!>a<!>: T?, <!UNUSED_PARAMETER!>b<!>: T?,
|
||||||
vararg <!UNUSED_PARAMETER!>functions<!>: T.() -> Comparable<*>?): Int = throw Exception()
|
vararg <!UNUSED_PARAMETER!>functions<!>: T.() -> Comparable<*>?): Int = throw Exception()
|
||||||
@@ -14,7 +14,7 @@ fun test(nullabilityInfoMap: Map<Int, Any>?) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//resolves to
|
//resolves to
|
||||||
public inline fun <K,V> Map<K,V>.iterator(): Iterator<Map.Entry<K,V>> {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
public fun <K,V> Map<K,V>.iterator(): Iterator<Map.Entry<K,V>> {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||||
|
|
||||||
|
|
||||||
//-------------
|
//-------------
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
public inline fun <T: Any> iterate(initialValue: T, nextFunction: (T) -> T?): Iterator<T> =
|
public fun <T: Any> iterate(initialValue: T, nextFunction: (T) -> T?): Iterator<T> =
|
||||||
throw Exception("$initialValue $nextFunction")
|
throw Exception("$initialValue $nextFunction")
|
||||||
|
|
||||||
fun foo() {
|
fun foo() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
|
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE
|
||||||
private class Z public (){
|
private class Z public (){
|
||||||
public val publicProperty:Int = 12
|
public val publicProperty:Int = 12
|
||||||
public fun publicFun() {}
|
public fun publicFun() {}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
|
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE
|
||||||
private class Z2 {
|
private class Z2 {
|
||||||
private val privateProperty = 11;
|
private val privateProperty = 11;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
|
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE
|
||||||
|
|
||||||
private val privateProperty = 11;
|
private val privateProperty = 11;
|
||||||
private fun privateFun() {}
|
private fun privateFun() {}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
|
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE
|
||||||
public class Z {
|
public class Z {
|
||||||
val privateProperty = 11;
|
val privateProperty = 11;
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// !DIAGNOSTICS: -NOTHING_TO_INLINE
|
||||||
// KT-860 ConcurrentModificationException in frontend
|
// KT-860 ConcurrentModificationException in frontend
|
||||||
|
|
||||||
package kotlin.util
|
package kotlin.util
|
||||||
@@ -10,4 +11,4 @@ fun <T, U: MutableCollection<in T>> Iterator<T>.to(container: U) : U {
|
|||||||
return container
|
return container
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fun <T> Iterator<T>.toArrayList() = to(ArrayList<T>())
|
fun <T> Iterator<T>.toArrayList() = to(ArrayList<T>())
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ package kotlin.test
|
|||||||
* Comments out a block of test code until it is implemented while keeping a link to the code
|
* Comments out a block of test code until it is implemented while keeping a link to the code
|
||||||
* to implement in your unit test output
|
* to implement in your unit test output
|
||||||
*/
|
*/
|
||||||
public inline fun todo(block: ()-> Any) {
|
public fun todo(block: ()-> Any) {
|
||||||
// println("TODO at " + (Exception() as java.lang.Throwable).getStackTrace()?.get(1) + " for " + block)
|
// println("TODO at " + (Exception() as java.lang.Throwable).getStackTrace()?.get(1) + " for " + block)
|
||||||
println("TODO at " + block)
|
println("TODO at " + block)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
package foo
|
package foo
|
||||||
|
|
||||||
class Foo {
|
public class Foo {
|
||||||
|
|
||||||
fun blah(): Int {
|
public fun blah(): Int {
|
||||||
return 5
|
return 5
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user