Fix tests: "Placing function type parameters after the function name" error

This commit is contained in:
Yan Zhulanow
2015-11-26 15:56:31 +03:00
parent 3001af56c9
commit a3ff3ffc45
435 changed files with 550 additions and 569 deletions
@@ -1,4 +1,4 @@
fun foo<T: Any>(<caret>_x1: T? = null, _x2: Double?, _x3: ((T) -> T)?) {
fun <T: Any> foo(<caret>_x1: T? = null, _x2: Double?, _x3: ((T) -> T)?) {
foo(2, 3.5, null);
val y1 = _x1;
val y2 = _x2;
@@ -1,4 +1,4 @@
fun foo<T: Any>(<caret>x1: T? = null, x2: Double, x3: ((T) -> T)?) {
fun <T: Any> foo(<caret>x1: T? = null, x2: Double, x3: ((T) -> T)?) {
foo(2, 3.5, null);
val y1 = x1;
val y2 = x2;
@@ -1,7 +1,7 @@
class U<A>
interface T<A, B> {
fun foofoofoo<C>(a: List<C>, b: A?, c: U<B>): U<C>?
fun <C> foofoofoo(a: List<C>, b: A?, c: U<B>): U<C>?
}
abstract class T1<X, Y> : T<U<X>, U<Y>> {
@@ -17,7 +17,7 @@ abstract class T2<X> : T1<X, String>() {
}
class T3 : T2<Any>() {
override fun foofoofoo<D>(a: List<D>, b: U<Any>?, c: U<U<String>>): U<D>? {
override fun <D> foofoofoo(a: List<D>, b: U<Any>?, c: U<U<String>>): U<D>? {
throw UnsupportedOperationException()
}
}
@@ -1,7 +1,7 @@
class U<A>
interface T<A, B> {
fun <caret>foofoofoo<C>(a: A, b: B, c: C): Int
fun <C> <caret>foofoofoo(a: A, b: B, c: C): Int
}
abstract class T1<X, Y> : T<U<X>, U<Y>> {
@@ -17,7 +17,7 @@ abstract class T2<X> : T1<X, String>() {
}
class T3 : T2<Any>() {
override fun foofoofoo<D>(a: U<Any>, b: U<String>, c: D): Int {
override fun <D> foofoofoo(a: U<Any>, b: U<String>, c: D): Int {
throw UnsupportedOperationException()
}
}
@@ -4,7 +4,7 @@ interface A<D> {
public fun <caret>bar(receiverTypes: Collection<X>): Collection<D>
}
fun foo<D>(): A<D> {
fun <D> foo(): A<D> {
return object: A<D> {
override fun bar(receiverTypes: Collection<X>): Collection<D> {
throw UnsupportedOperationException()
@@ -4,7 +4,7 @@ interface A<D> {
public fun <caret>foo(receiverTypes: Collection<X>): Collection<D>
}
fun foo<D>(): A<D> {
fun <D> foo(): A<D> {
return object: A<D> {
override fun foo(receiverTypes: Collection<X>): Collection<D> {
throw UnsupportedOperationException()
@@ -6,7 +6,7 @@
// PARAM_DESCRIPTOR: value-parameter val b: B defined in foo
// PARAM_DESCRIPTOR: var c: kotlin.Int defined in foo
// SIBLING:
fun foo<A: Any, B: A>(b: B): Int {
fun <A: Any, B: A> foo(b: B): Int {
var a: A? = null
var c: Int = 1
@@ -6,7 +6,7 @@
// PARAM_DESCRIPTOR: value-parameter val b: B defined in foo
// PARAM_DESCRIPTOR: var c: kotlin.Int defined in foo
// SIBLING:
fun foo<A: Any, B: A>(b: B): Int {
fun <A: Any, B: A> foo(b: B): Int {
var a: A? = null
var c: Int = 1
@@ -2,7 +2,7 @@
fun foo() {
open class X(val x: Int)
fun bar<T: X>(t: T): Int {
fun <T: X> bar(t: T): Int {
return <selection>t.x + 1</selection>
}
}
@@ -2,7 +2,7 @@
fun foo() {
open class X(val x: Int)
fun bar<T>(t: T): Int where T: X {
fun <T> bar(t: T): Int where T: X {
return <selection>t.x + 1</selection>
}
}
@@ -5,6 +5,6 @@ open class Data(val x: Int)
class Pair<A, B>(val a: A, val b: B)
// SIBLING:
fun foo<V: Data>(v: V): Pair<Int, V> {
fun <V: Data> foo(v: V): Pair<Int, V> {
return <selection>Pair(v.x + 10, v)</selection>
}
@@ -5,7 +5,7 @@ open class Data(val x: Int)
class Pair<A, B>(val a: A, val b: B)
// SIBLING:
fun foo<V: Data>(v: V): Pair<Int, V> {
fun <V: Data> foo(v: V): Pair<Int, V> {
return pair(v)
}
@@ -6,6 +6,6 @@ interface DataEx
class Pair<A, B>(val a: A, val b: B)
// SIBLING:
fun foo<V: Data>(v: V): Pair<Int, V> where V: DataEx {
fun <V: Data> foo(v: V): Pair<Int, V> where V: DataEx {
return <selection>Pair(v.x + 10, v)</selection>
}
@@ -6,7 +6,7 @@ interface DataEx
class Pair<A, B>(val a: A, val b: B)
// SIBLING:
fun foo<V: Data>(v: V): Pair<Int, V> where V: DataEx {
fun <V: Data> foo(v: V): Pair<Int, V> where V: DataEx {
return pair(v)
}
@@ -1,6 +1,6 @@
// SUGGESTED_NAMES: i, getA
fun foo<U>() = 1
fun <U> foo() = 1
fun test<T>() {
fun <T> test() {
val a = <selection>foo<T>()</selection>
}
@@ -1,7 +1,7 @@
// SUGGESTED_NAMES: i, getA
fun foo<U>() = 1
fun <U> foo() = 1
fun test<T>() {
fun <T> test() {
val a = i<T>()
}
@@ -1,8 +1,8 @@
// SUGGESTED_NAMES: i, getA
// PARAM_DESCRIPTOR: value-parameter val t: T defined in test
// PARAM_TYPES: T
fun foo<U>(u: U) = 1
fun <U> foo(u: U) = 1
fun test<T>(t: T) {
fun <T> test(t: T) {
val a = <selection>foo<T>(t)</selection>
}
@@ -1,9 +1,9 @@
// SUGGESTED_NAMES: i, getA
// PARAM_DESCRIPTOR: value-parameter val t: T defined in test
// PARAM_TYPES: T
fun foo<U>(u: U) = 1
fun <U> foo(u: U) = 1
fun test<T>(t: T) {
fun <T> test(t: T) {
val a = i(t)
}
@@ -11,7 +11,7 @@ interface DataExEx
// SIBLING:
class A<T: Data>(val t: T) where T: DataEx {
inner class B<U: Data>(val u: U) where U: DataExEx {
fun foo<V: Data>(v: V): Int where V: DataEx {
fun <V: Data> foo(v: V): Int where V: DataEx {
return <selection>t.x + u.x + v.x</selection>
}
}
@@ -11,7 +11,7 @@ interface DataExEx
// SIBLING:
class A<T: Data>(val t: T) where T: DataEx {
inner class B<U: Data>(val u: U) where U: DataExEx {
fun foo<V: Data>(v: V): Int where V: DataEx {
fun <V: Data> foo(v: V): Int where V: DataEx {
return i(this@A, this@B, v)
}
}
@@ -9,7 +9,7 @@ interface DataExEx
class A<T: Data>(val t: T) where T: DataEx {
// SIBLING:
inner class B<U: Data>(val u: U) where U: DataExEx {
fun foo<V: Data>(v: V): Int where V: DataEx {
fun <V: Data> foo(v: V): Int where V: DataEx {
return <selection>t.x + u.x + v.x</selection>
}
}
@@ -9,7 +9,7 @@ interface DataExEx
class A<T: Data>(val t: T) where T: DataEx {
// SIBLING:
inner class B<U: Data>(val u: U) where U: DataExEx {
fun foo<V: Data>(v: V): Int where V: DataEx {
fun <V: Data> foo(v: V): Int where V: DataEx {
return i(v)
}
}
@@ -7,7 +7,7 @@ interface DataExEx
class A<T: Data>(val t: T) where T: DataEx {
inner class B<U: Data>(val u: U) where U: DataExEx {
// SIBLING:
fun foo<V: Data>(v: V): Int where V: DataEx {
fun <V: Data> foo(v: V): Int where V: DataEx {
return <selection>t.x + u.x + v.x</selection>
}
}
@@ -7,7 +7,7 @@ interface DataExEx
class A<T: Data>(val t: T) where T: DataEx {
inner class B<U: Data>(val u: U) where U: DataExEx {
// SIBLING:
fun foo<V: Data>(v: V): Int where V: DataEx {
fun <V: Data> foo(v: V): Int where V: DataEx {
return i(v)
}
@@ -9,7 +9,7 @@ open class Data(val x: Int)
// SIBLING:
class A<T: Data>(val t: T) {
inner class B<U: Data>(val u: U) {
fun foo<V: Data>(v: V): Int {
fun <V: Data> foo(v: V): Int {
return <selection>t.x + u.x + v.x</selection>
}
}
@@ -9,7 +9,7 @@ open class Data(val x: Int)
// SIBLING:
class A<T: Data>(val t: T) {
inner class B<U: Data>(val u: U) {
fun foo<V: Data>(v: V): Int {
fun <V: Data> foo(v: V): Int {
return i(this@A, this@B, v)
}
}
@@ -7,7 +7,7 @@ open class Data(val x: Int)
class A<T: Data>(val t: T) {
// SIBLING:
inner class B<U: Data>(val u: U) {
fun foo<V: Data>(v: V): Int {
fun <V: Data> foo(v: V): Int {
return <selection>t.x + u.x + v.x</selection>
}
}
@@ -7,7 +7,7 @@ open class Data(val x: Int)
class A<T: Data>(val t: T) {
// SIBLING:
inner class B<U: Data>(val u: U) {
fun foo<V: Data>(v: V): Int {
fun <V: Data> foo(v: V): Int {
return i(v)
}
}
@@ -5,7 +5,7 @@ open class Data(val x: Int)
class A<T: Data>(val t: T) {
inner class B<U: Data>(val u: U) {
// SIBLING:
fun foo<V: Data>(v: V): Int {
fun <V: Data> foo(v: V): Int {
return <selection>t.x + u.x + v.x</selection>
}
}
@@ -5,7 +5,7 @@ open class Data(val x: Int)
class A<T: Data>(val t: T) {
inner class B<U: Data>(val u: U) {
// SIBLING:
fun foo<V: Data>(v: V): Int {
fun <V: Data> foo(v: V): Int {
return i(v)
}
@@ -7,7 +7,7 @@ interface DataEx
// SIBLING:
class A<T: Data>(val t: T) where T: DataEx {
fun foo<V: Data>(v: V): Int {
fun <V: Data> foo(v: V): Int {
return <selection>t.x + v.x</selection>
}
}
@@ -7,7 +7,7 @@ interface DataEx
// SIBLING:
class A<T: Data>(val t: T) where T: DataEx {
fun foo<V: Data>(v: V): Int {
fun <V: Data> foo(v: V): Int {
return i(v)
}
}
@@ -6,7 +6,7 @@ interface Z<T>
class C<W: I> {
inner class <caret>B<X: I, Y>(x: X, y: Y): A<X, I, Z<Y>>() {
// INFO: {"checked": "true"}
fun foo<S : X>(x1: X, x2: Z<X>, y1: Y, y2: Z<Y>, w1: W, w2: Z<W>, s1: S, s2: Z<S>) {
fun <S : X> foo(x1: X, x2: Z<X>, y1: Y, y2: Z<Y>, w1: W, w2: Z<W>, s1: S, s2: Z<S>) {
}
// INFO: {"checked": "true"}
@@ -6,7 +6,7 @@ interface Z<T>
class C<W: I> {
inner class B<X: I, Y>(x: X, y: Y): A<X, I, Z<Y>>() {
// INFO: {"checked": "true"}
override fun foo<S : X>(x1: X, x2: Z<X>, y1: Y, y2: Z<Y>, w1: W, w2: Z<W>, s1: S, s2: Z<S>) {
override fun <S : X> foo(x1: X, x2: Z<X>, y1: Y, y2: Z<Y>, w1: W, w2: Z<W>, s1: S, s2: Z<S>) {
}
@@ -8,7 +8,7 @@ open class A<T: I, U: I, V>
class C<W: I> {
inner class <caret>B<X: I, Y>(x: X, y: Y): A<X, I, Z<Y>>() {
// INFO: {"checked": "true"}
fun foo<S>(x1: X, x2: Z<X>, y1: Y, y2: Z<Y>, w1: W, w2: Z<W>, s1: S, s2: Z<S>) {
fun <S> foo(x1: X, x2: Z<X>, y1: Y, y2: Z<Y>, w1: W, w2: Z<W>, s1: S, s2: Z<S>) {
}
// INFO: {"checked": "true"}
@@ -22,7 +22,7 @@ abstract class A<T: I, U: I, V>(x: T, y: Any?) {
abstract val foo8: Z<Any?>
// INFO: {"checked": "true"}
fun foo<S>(x1: T, x2: Z<T>, y1: Any?, y2: Z<Any?>, w1: I, w2: Z<I>, s1: S, s2: Z<S>) {
fun <S> foo(x1: T, x2: Z<T>, y1: Any?, y2: Z<Any?>, w1: I, w2: Z<I>, s1: S, s2: Z<S>) {
}
@@ -7,7 +7,7 @@ open class <caret>A<T> {
val t2: Z<T>
// INFO: {"checked": "true"}
fun foo<S>(t1: T, t2: Z<T>, s1: S, s2: Z<S>): Boolean = true
fun <S> foo(t1: T, t2: Z<T>, s1: S, s2: Z<S>): Boolean = true
// INFO: {"checked": "true"}
inner class X : Z<T> {
@@ -11,7 +11,7 @@ class B<S> : A<Z<S>>() {
val t2: Z<Z<S>>
// INFO: {"checked": "true"}
fun foo<S>(t1: Z<S>, t2: Z<Z<S>>, s1: S, s2: Z<S>): Boolean = true
fun <S> foo(t1: Z<S>, t2: Z<Z<S>>, s1: S, s2: Z<S>): Boolean = true
// INFO: {"checked": "true"}
inner class X : Z<Z<S>> {
@@ -32,7 +32,7 @@ class C<K> : A<B<K>>() {
val t2: Z<B<K>>
// INFO: {"checked": "true"}
fun foo<S>(t1: B<K>, t2: Z<B<K>>, s1: S, s2: Z<S>): Boolean = true
fun <S> foo(t1: B<K>, t2: Z<B<K>>, s1: S, s2: Z<S>): Boolean = true
// INFO: {"checked": "true"}
inner class X : Z<B<K>> {
@@ -4,4 +4,4 @@ data class Pair<out A, out B>(
)
public fun listOf<T>(): List<T> = throw Error()
public fun <T> listOf(): List<T> = throw Error()
@@ -4,4 +4,4 @@ data class Pair<out A, out B>(
)
public fun listOf<T>(): List<T> = throw Error()
public fun <T> listOf(): List<T> = throw Error()