Fix tests ('infix')

This commit is contained in:
Yan Zhulanow
2015-09-30 21:27:45 +03:00
parent 7e8674c6ee
commit 1b01e7a85a
65 changed files with 146 additions and 132 deletions
@@ -13,5 +13,5 @@ fun test() {
// from library
class Pair<out A, out B>
fun <K, V> mapOf(keyValuePair: Pair<K, V>): Map<K, V> = throw Exception()
fun <A, B> A.to(that: B): Pair<A, B> = throw Exception()
infix fun <A, B> A.to(that: B): Pair<A, B> = throw Exception()
@@ -4,7 +4,7 @@ public fun </*0*/ T> bar(/*0*/ t: T, /*1*/ ext: GenericClass<T>.() -> kotlin.Uni
public fun </*0*/ K, /*1*/ V> mapOf(/*0*/ keyValuePair: Pair<K, V>): kotlin.Map<K, V>
public fun test(): kotlin.Unit
public fun </*0*/ K, /*1*/ V> GenericClass<kotlin.Map<K, V>>.foo(): kotlin.Unit
public fun </*0*/ A, /*1*/ B> A.to(/*0*/ that: B): Pair<A, B>
public infix fun </*0*/ A, /*1*/ B> A.to(/*0*/ that: B): Pair<A, B>
public final class GenericClass</*0*/ out T> {
public constructor GenericClass</*0*/ out T>()
@@ -25,10 +25,10 @@ fun foo() {
// ---------------------
// copy from kotlin util
// copy from kotlin util (but with `infix` modifier on `map`)
fun <T> array(vararg t : T) : Array<T> = t as Array<T>
fun <T, R> Array<T>.map(<!UNUSED_PARAMETER!>transform<!> : (T) -> R) : List<R> {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
infix fun <T, R> Array<T>.map(<!UNUSED_PARAMETER!>transform<!> : (T) -> R) : List<R> {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
fun <T, R> Iterable<T>.map(<!UNUSED_PARAMETER!>transform<!> : (T) -> R) : List<R> {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
infix fun <T, R> Iterable<T>.map(<!UNUSED_PARAMETER!>transform<!> : (T) -> R) : List<R> {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
@@ -3,6 +3,6 @@ package
package a {
public fun </*0*/ T> array(/*0*/ vararg t: T /*kotlin.Array<out T>*/): kotlin.Array<T>
public fun foo(): kotlin.Unit
public fun </*0*/ T, /*1*/ R> kotlin.Array<T>.map(/*0*/ transform: (T) -> R): kotlin.List<R>
public fun </*0*/ T, /*1*/ R> kotlin.Iterable<T>.map(/*0*/ transform: (T) -> R): kotlin.List<R>
public infix fun </*0*/ T, /*1*/ R> kotlin.Array<T>.map(/*0*/ transform: (T) -> R): kotlin.List<R>
public infix fun </*0*/ T, /*1*/ R> kotlin.Iterable<T>.map(/*0*/ transform: (T) -> R): kotlin.List<R>
}
@@ -10,7 +10,7 @@ fun <T> id(t: T): T = t
//binary expressions
//identifier
fun <T> Z.foo(a: A<T>): A<T> = a
infix fun <T> Z.foo(a: A<T>): A<T> = a
fun test(z: Z) {
z <!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>foo<!> <!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>newA<!>()
@@ -13,7 +13,7 @@ package h {
public fun use(/*0*/ vararg a: kotlin.Any? /*kotlin.Array<out kotlin.Any?>*/): kotlin.Array<out kotlin.Any?>
public operator fun </*0*/ T> h.Z.compareTo(/*0*/ a: h.A<T>): kotlin.Int
public fun h.Z.equals(/*0*/ any: kotlin.Any): kotlin.Int
public fun </*0*/ T> h.Z.foo(/*0*/ a: h.A<T>): h.A<T>
public infix fun </*0*/ T> h.Z.foo(/*0*/ a: h.A<T>): h.A<T>
public operator fun </*0*/ T> h.Z.plus(/*0*/ a: h.A<T>): h.A<T>
public interface A</*0*/ T> {
@@ -2,7 +2,7 @@
package aaa
fun <T> T.foo(t: T) = t
infix fun <T> T.foo(t: T) = t
fun <T> id(t: T) = t
@@ -3,5 +3,5 @@ package
package aaa {
public fun a(): kotlin.Unit
public fun </*0*/ T> id(/*0*/ t: T): T
public fun </*0*/ T> T.foo(/*0*/ t: T): T
public infix fun </*0*/ T> T.foo(/*0*/ t: T): T
}
@@ -10,7 +10,7 @@ public fun <T> query(<!UNUSED_PARAMETER!>t<!>: T, <!UNUSED_PARAMETER!>args<!>: M
fun test(pair: Pair<String, Int>) {
val id = "Hello" // variable is marked as unused
println("Some" + query(0, mapOf(id to 1)))
println("Some" + query(0, mapOf(id to 1)))
println("Some" + query(0, mapOf(pair)))
}
@@ -19,7 +19,7 @@ fun test(pair: Pair<String, Int>) {
//from standard library
fun <K, V> mapOf(vararg <!UNUSED_PARAMETER!>values<!>: Pair<K, V>): Map<K, V> { throw Exception() }
fun <A,B> A.to(<!UNUSED_PARAMETER!>that<!>: B): Pair<A, B> { throw Exception() }
infix fun <A,B> A.to(<!UNUSED_PARAMETER!>that<!>: B): Pair<A, B> { throw Exception() }
fun println(<!UNUSED_PARAMETER!>message<!> : Any?) { throw Exception() }
@@ -7,7 +7,7 @@ package b {
public fun </*0*/ T> query(/*0*/ t: T, /*1*/ args: kotlin.Map<kotlin.String, kotlin.Any>): kotlin.List<T>
public fun test(/*0*/ pair: b.Pair<kotlin.String, kotlin.Int>): kotlin.Unit
public fun test(/*0*/ t: kotlin.String): kotlin.Unit
public fun </*0*/ A, /*1*/ B> A.to(/*0*/ that: B): b.Pair<A, B>
public infix fun </*0*/ A, /*1*/ B> A.to(/*0*/ that: B): b.Pair<A, B>
public final class Pair</*0*/ out A, /*1*/ out B> {
public constructor Pair</*0*/ out A, /*1*/ out B>()
@@ -6,7 +6,7 @@ package i
public fun<T> from(<!UNUSED_PARAMETER!>yielder<!>: ()->Iterable<T>) : Iterable<T> {
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
public fun<T> Iterable<T>.where(<!UNUSED_PARAMETER!>predicate<!> : (T)->Boolean) : ()->Iterable<T> {
public infix fun<T> Iterable<T>.where(<!UNUSED_PARAMETER!>predicate<!> : (T)->Boolean) : ()->Iterable<T> {
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
fun a() {
@@ -3,5 +3,5 @@ package
package i {
public fun a(): kotlin.Unit
public fun </*0*/ T> from(/*0*/ yielder: () -> kotlin.Iterable<T>): kotlin.Iterable<T>
public fun </*0*/ T> kotlin.Iterable<T>.where(/*0*/ predicate: (T) -> kotlin.Boolean): () -> kotlin.Iterable<T>
public infix fun </*0*/ T> kotlin.Iterable<T>.where(/*0*/ predicate: (T) -> kotlin.Boolean): () -> kotlin.Iterable<T>
}
@@ -5,7 +5,7 @@ package i
import java.util.ArrayList
public fun<TItem> Iterable<TItem>.where(<!UNUSED_PARAMETER!>predicate<!> : (TItem)->Boolean) : ()->Iterable<TItem> {
public infix fun<TItem> Iterable<TItem>.where(<!UNUSED_PARAMETER!>predicate<!> : (TItem)->Boolean) : ()->Iterable<TItem> {
<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
public fun<TItem, TResult> select(<!UNUSED_PARAMETER!>yielder<!>: ()->Iterable<TItem>, <!UNUSED_PARAMETER!>selector<!> : (TItem)->TResult) : ()->Iterable<TResult> {
@@ -3,5 +3,5 @@ package
package i {
public fun a(): kotlin.Unit
public fun </*0*/ TItem, /*1*/ TResult> select(/*0*/ yielder: () -> kotlin.Iterable<TItem>, /*1*/ selector: (TItem) -> TResult): () -> kotlin.Iterable<TResult>
public fun </*0*/ TItem> kotlin.Iterable<TItem>.where(/*0*/ predicate: (TItem) -> kotlin.Boolean): () -> kotlin.Iterable<TItem>
public infix fun </*0*/ TItem> kotlin.Iterable<TItem>.where(/*0*/ predicate: (TItem) -> kotlin.Boolean): () -> kotlin.Iterable<TItem>
}