Test compilation fix

This commit is contained in:
Mikhael Bogdanov
2013-11-21 13:52:17 +04:00
parent 191891963c
commit d11311ec20
13 changed files with 15 additions and 14 deletions
@@ -1,6 +1,6 @@
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 next() = nextElement()
@@ -1,6 +1,6 @@
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 next() = nextElement()
@@ -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})
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")
@@ -5,5 +5,5 @@ class Item(val name: String, val rating: Int): Comparable<Item> {
}
// 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()
@@ -14,7 +14,7 @@ fun test(nullabilityInfoMap: Map<Int, Any>?) {
}
//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,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")
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 (){
public val publicProperty:Int = 12
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 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 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 {
val privateProperty = 11;
@@ -1,3 +1,4 @@
// !DIAGNOSTICS: -NOTHING_TO_INLINE
// KT-860 ConcurrentModificationException in frontend
package kotlin.util
@@ -10,4 +11,4 @@ fun <T, U: MutableCollection<in T>> Iterator<T>.to(container: U) : U {
return container
}
inline fun <T> Iterator<T>.toArrayList() = to(ArrayList<T>())
fun <T> Iterator<T>.toArrayList() = to(ArrayList<T>())
+1 -1
View File
@@ -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
* 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 " + block)
}
@@ -1,8 +1,8 @@
package foo
class Foo {
public class Foo {
fun blah(): Int {
public fun blah(): Int {
return 5
}