Create From Usage: Move "Create function"-related tests to separate directory

This commit is contained in:
Alexey Sedunov
2014-09-29 16:36:57 +04:00
parent 0f43d4d07c
commit a6ba3a569d
138 changed files with 526 additions and 504 deletions
@@ -0,0 +1,11 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T) {
fun foo(arg: T): A<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
val a: A<Int> = A(1) foo 2
}
@@ -0,0 +1,11 @@
// "Create function 'compareTo' from usage" "true"
class A<T>(val n: T) {
fun compareTo(arg: T): Int {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
A(1) >= 2
}
@@ -0,0 +1,11 @@
// "Create function 'contains' from usage" "true"
class A<T>(val n: T) {
fun contains(arg: T): Boolean {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
2 in A(1)
}
@@ -0,0 +1,11 @@
// "Create function 'compareTo' from usage" "true"
class A<T>(val n: T) {
fun compareTo(arg: T): Int {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
A(1) < 2
}
@@ -0,0 +1,11 @@
// "Create function 'contains' from usage" "true"
class A<T>(val n: T) {
fun contains(arg: T): Boolean {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
2 !in A(1)
}
@@ -0,0 +1,11 @@
// "Create function 'plusAssign' from usage" "true"
class A<T>(val n: T) {
fun plusAssign(arg: T): Unit {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
A(1) += 2
}
@@ -0,0 +1,13 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T) {
fun plus(): A<T> = throw Exception()
fun plus(arg: T): A<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
val a: A<Int> = A(1) + 2
}
@@ -0,0 +1,12 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T) {
fun plus(arg: T): A<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
var a = A(1)
a = a + 2
}
@@ -0,0 +1,13 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T) {
fun plus(i: Int, s: String): A<T> = throw Exception()
fun plus(arg: T): A<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
val a: A<Int> = A(1) + 2
}
@@ -0,0 +1,11 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T)
fun test() {
val a: A<Int> = 2 + A(1)
}
fun Int.plus(A: A<Int>): A<Int> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@@ -0,0 +1,11 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T) {
fun plus(arg: T): A<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
val a: A<Int> = A(1) + 2
}
@@ -0,0 +1,11 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T) {
fun plus(i: Int): A<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test<U>(u: U) {
val a: A<U> = A(u) + 2
}
@@ -0,0 +1,13 @@
// "Create function 'contains' from usage" "true"
class A<T>(val n: T) {
fun contains(arg: T): Boolean {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
when {
2 in A(1) -> {}
}
}
@@ -0,0 +1,13 @@
// "Create function 'contains' from usage" "true"
class A<T>(val n: T) {
fun contains(arg: T): Boolean {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
when {
2 !in A(1) -> {}
}
}
@@ -0,0 +1,7 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T)
fun test() {
val a: A<Int> = A(1) <caret>foo 2
}
@@ -0,0 +1,7 @@
// "Create function 'compareTo' from usage" "true"
class A<T>(val n: T)
fun test() {
A(1) <caret>>= 2
}
@@ -0,0 +1,7 @@
// "Create function 'contains' from usage" "true"
class A<T>(val n: T)
fun test() {
2 <caret>in A(1)
}
@@ -0,0 +1,7 @@
// "Create function 'compareTo' from usage" "true"
class A<T>(val n: T)
fun test() {
A(1) <caret>< 2
}
@@ -0,0 +1,7 @@
// "Create function 'contains' from usage" "true"
class A<T>(val n: T)
fun test() {
2 <caret>!in A(1)
}
@@ -0,0 +1,7 @@
// "Create function 'plusAssign' from usage" "true"
class A<T>(val n: T)
fun test() {
A(1) <caret>+= 2
}
@@ -0,0 +1,9 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T) {
fun plus(): A<T> = throw Exception()
}
fun test() {
val a: A<Int> = A(1) + <caret>2
}
@@ -0,0 +1,8 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T)
fun test() {
var a = A(1)
a = a <caret>+ 2
}
@@ -0,0 +1,9 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T) {
fun plus(i: Int, s: String): A<T> = throw Exception()
}
fun test() {
val a: A<Int> = A(1) <caret>+ 2
}
@@ -0,0 +1,7 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T)
fun test() {
val a: A<Int> = 2 <caret>+ A(1)
}
@@ -0,0 +1,7 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T)
fun test() {
val a: A<Int> = A(1) <caret>+ 2
}
@@ -0,0 +1,7 @@
// "Create function 'plus' from usage" "true"
class A<T>(val n: T)
fun test<U>(u: U) {
val a: A<U> = A(u) <caret>+ 2
}
@@ -0,0 +1,9 @@
// "Create function 'contains' from usage" "true"
class A<T>(val n: T)
fun test() {
when {
2 <caret>in A(1) -> {}
}
}
@@ -0,0 +1,9 @@
// "Create function 'contains' from usage" "true"
class A<T>(val n: T)
fun test() {
when {
2 <caret>!in A(1) -> {}
}
}
@@ -0,0 +1,12 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T) {
fun foo(arg: T, s: String, function: Function1<T, T>): A<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
val a: A<Int> = A(1).foo(2, "2") { (p: Int) -> p + 1 }
}
@@ -0,0 +1,12 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T) {
fun foo(function: Function1<T, T>): A<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
val a: A<Int> = A(1).foo { (p: Int) -> p + 1 }
}
@@ -0,0 +1,13 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T) {
fun foo(a: Int): A<T> = throw Exception()
fun foo(arg: T, s: String): A<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
val a: A<Int> = A(1).foo(2, "2")
}
@@ -0,0 +1,13 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T) {
fun foo(i: Int, s: String): A<T> = throw Exception()
fun foo(arg: T): A<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
val a: A<Int> = A(1).foo(2)
}
@@ -0,0 +1,14 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T) {
class object {
fun foo(i: Int): Int {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
}
fun test() {
val a: Int = A.foo(2)
}
@@ -0,0 +1,9 @@
// "Create function 'foo' from usage" "true"
fun test() {
val a: Int = Unit.foo(2)
}
fun Unit.foo(i: Int): Int {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@@ -0,0 +1,11 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T)
fun test() {
val a: A<Int> = 2.foo(A(1))
}
fun Int.foo(A: A<Int>): A<Int> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@@ -0,0 +1,11 @@
// "Create function 'foo' from usage" "true"
object A {
fun foo(i: Int): Int {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
val a: Int = A.foo(2)
}
@@ -0,0 +1,11 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T) {
fun foo(arg: T): A<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
val a: A<Int> = A(1).foo(2)
}
@@ -0,0 +1,11 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T) {
fun foo(u: T): A<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test<U>(u: U) {
val a: A<U> = A(u).foo(u)
}
@@ -0,0 +1,11 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T) {
fun foo(abc: T, ghi: A<T>, def: String): A<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test() {
val a: A<Int> = A(1).foo(abc = 1, ghi = A(2), def = "s")
}
@@ -0,0 +1,12 @@
// "Create function 'foo' from usage" "true"
// ERROR: <html>Type mismatch.<table><tr><td>Required:</td><td>kotlin.Int</td></tr><tr><td>Found:</td><td>A&lt;kotlin.Int&gt;</td></tr></table></html>
class A<T>(val n: T) {
fun foo(s: String, arg: T): Any {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test(): Int {
return A(1).foo("s", 1) as A<Int>
}
@@ -0,0 +1,11 @@
// "Create function 'foo' from usage" "true"
fun test() {
fun foo(i: Int, s: String): Int {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
fun nestedTest(): Int {
return foo(2, "2")
}
}
@@ -0,0 +1,13 @@
// "Create function 'foo' from usage" "true"
class A {
class B {
fun test(): Int {
return foo(2, "2")
}
fun foo(i: Int, s: String): Int {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
}
@@ -0,0 +1,13 @@
// "Create function 'foo' from usage" "true"
class A {
object B {
fun test(): Int {
return foo(2, "2")
}
fun foo(i: Int, s: String): Int {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
}
@@ -0,0 +1,11 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T) {
fun test(): A<Int> {
return this.foo(2, "2")
}
fun foo(i: Int, s: String): A<Int> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -0,0 +1,11 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T) {
fun foo(i: Int, s: String): A<Int> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun <U> A<U>.test(): A<Int> {
return this.foo(2, "2")
}
@@ -0,0 +1,13 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T) {
inner class B<U>(val m: U) {
fun test(): A<Int> {
return this.foo(2, "2")
}
fun foo(i: Int, s: String): A<Int> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
}
@@ -0,0 +1,13 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T) {
inner class B<U>(val m: U) {
fun test(): A<Int> {
return this@A.foo(2, "2")
}
}
fun foo(i: Int, s: String): A<Int> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -0,0 +1,9 @@
// "Create function 'foo' from usage" "true"
fun test(): Int {
return foo(2, "2")
}
fun foo(i: Int, s: String): Int {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@@ -0,0 +1,12 @@
// "Create function 'foo' from usage" "true"
// ERROR: Unresolved reference: s
class A<T>(val n: T) {
fun foo(s: Any, arg: T): T {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun test(): Int {
return A(1).foo(s, 1)
}
@@ -0,0 +1,9 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T) {
}
fun test() {
val a: A<Int> = A(1).<caret>foo(2, "2") { (p: Int) -> p + 1 }
}
@@ -0,0 +1,9 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T) {
}
fun test() {
val a: A<Int> = A(1).<caret>foo { (p: Int) -> p + 1 }
}
@@ -0,0 +1,9 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T) {
fun foo(a: Int): A<T> = throw Exception()
}
fun test() {
val a: A<Int> = A(1).foo(2, <caret>"2")
}
@@ -0,0 +1,9 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T) {
fun foo(i: Int, s: String): A<T> = throw Exception()
}
fun test() {
val a: A<Int> = A(1).foo(2<caret>)
}
@@ -0,0 +1,11 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T) {
class object {
}
}
fun test() {
val a: Int = A.<caret>foo(2)
}
@@ -0,0 +1,5 @@
// "Create function 'foo' from usage" "true"
fun test() {
val a: Int = Unit.<caret>foo(2)
}
@@ -0,0 +1,7 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T)
fun test() {
val a: A<Int> = 2.<caret>foo(A(1))
}
@@ -0,0 +1,7 @@
// "Create function 'foo' from usage" "true"
object A
fun test() {
val a: Int = A.<caret>foo(2)
}
@@ -0,0 +1,7 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T)
fun test() {
val a: A<Int> = A(1).<caret>foo(2)
}
@@ -0,0 +1,7 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T)
fun test<U>(u: U) {
val a: A<U> = A(u).<caret>foo(u)
}
@@ -0,0 +1,7 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T)
fun test() {
val a: A<Int> = A(1).<caret>foo(abc = 1, ghi = A(2), def = "s")
}
@@ -0,0 +1,8 @@
// "Create function 'foo' from usage" "true"
// ERROR: <html>Type mismatch.<table><tr><td>Required:</td><td>kotlin.Int</td></tr><tr><td>Found:</td><td>A&lt;kotlin.Int&gt;</td></tr></table></html>
class A<T>(val n: T)
fun test(): Int {
return A(1).<caret>foo("s", 1) as A<Int>
}
@@ -0,0 +1,7 @@
// "Create function 'foo' from usage" "true"
fun test() {
fun nestedTest(): Int {
return <caret>foo(2, "2")
}
}
@@ -0,0 +1,9 @@
// "Create function 'foo' from usage" "true"
class A {
class B {
fun test(): Int {
return <caret>foo(2, "2")
}
}
}
@@ -0,0 +1,9 @@
// "Create function 'foo' from usage" "true"
class A {
object B {
fun test(): Int {
return <caret>foo(2, "2")
}
}
}
@@ -0,0 +1,7 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T) {
fun test(): A<Int> {
return this.<caret>foo(2, "2")
}
}
@@ -0,0 +1,7 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T)
fun <U> A<U>.test(): A<Int> {
return this.<caret>foo(2, "2")
}
@@ -0,0 +1,9 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T) {
inner class B<U>(val m: U) {
fun test(): A<Int> {
return this.<caret>foo(2, "2")
}
}
}
@@ -0,0 +1,9 @@
// "Create function 'foo' from usage" "true"
class A<T>(val n: T) {
inner class B<U>(val m: U) {
fun test(): A<Int> {
return this@A.<caret>foo(2, "2")
}
}
}
@@ -0,0 +1,5 @@
// "Create function 'foo' from usage" "true"
fun test(): Int {
return <caret>foo(2, "2")
}
@@ -0,0 +1,8 @@
// "Create function 'foo' from usage" "true"
// ERROR: Unresolved reference: s
class A<T>(val n: T)
fun test(): Int {
return A(1).<caret>foo(s, 1)
}
@@ -0,0 +1,12 @@
// "Create function 'component3' from usage" "true"
class Foo<T> {
fun component1(): Int { return 0 }
fun component2(): Int { return 0 }
fun component3(): Any {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun foo() {
val (a, b, c) = Foo<Int>()
}
@@ -0,0 +1,12 @@
// "Create function 'component3' from usage" "true"
class Foo<T> {
fun component1(): Int { return 0 }
fun component2(): Int { return 0 }
fun component3(): String {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun foo() {
val (a, b, c: String) = Foo<Int>()
}
@@ -0,0 +1,22 @@
// "Create function 'component2' from usage" "true"
class FooIterator<T> {
fun hasNext(): Boolean { return false }
fun next(): Any {
throw UnsupportedOperationException("not implemented")
}
}
class Foo<T> {
fun iterator(): FooIterator<String> {
throw UnsupportedOperationException("not implemented")
}
}
fun Any.component1(): Int {
return 0
}
fun foo() {
for ((i: Int, j: Int) in Foo<Int>()) { }
}
fun Any.component2(): Int {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@@ -0,0 +1,8 @@
// "Create function 'component3' from usage" "true"
class Foo<T> {
fun component1(): Int { return 0 }
fun component2(): Int { return 0 }
}
fun foo() {
val (a, b, c) = Foo<caret><Int>()
}
@@ -0,0 +1,8 @@
// "Create function 'component3' from usage" "true"
class Foo<T> {
fun component1(): Int { return 0 }
fun component2(): Int { return 0 }
}
fun foo() {
val (a, b, c: String) = Foo<caret><Int>()
}
@@ -0,0 +1,18 @@
// "Create function 'component2' from usage" "true"
class FooIterator<T> {
fun hasNext(): Boolean { return false }
fun next(): Any {
throw UnsupportedOperationException("not implemented")
}
}
class Foo<T> {
fun iterator(): FooIterator<String> {
throw UnsupportedOperationException("not implemented")
}
}
fun Any.component1(): Int {
return 0
}
fun foo() {
for ((i: Int, j: Int) in Foo<caret><Int>()) { }
}
@@ -0,0 +1,10 @@
// "Create function 'get' from usage" "true"
class Foo<T> {
fun x (y: Foo<Iterable<T>>) {
val z: Iterable<T> = y[""]
}
fun get(s: String): T {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -0,0 +1,10 @@
// "Create function 'get' from usage" "true"
class Foo<T> {
fun <T> x (y: Foo<List<T>>, w: java.util.ArrayList<T>) {
val z: Iterable<T> = y["", w]
}
fun get(s: String, w: T): T {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -0,0 +1,9 @@
// "Create function 'get' from usage" "true"
class Foo<T> {
fun get(s: String, w: T): T {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun <T> x (y: Foo<List<T>>, w: java.util.ArrayList<T>) {
val z: Iterable<T> = y["", w]
}
@@ -0,0 +1,9 @@
// "Create function 'get' from usage" "true"
class Foo<T> {
fun get(s: String, w: T): Any {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
fun <T> x (y: Foo<List<T>>, w: java.util.ArrayList<T>) {
val z = y["", w]
}
@@ -0,0 +1,14 @@
// "Create function 'get' from usage" "true"
import java.util.ArrayList
class Foo<T> {
fun bar(arg: String) { }
fun <T, V> x (y: Foo<List<T>>, w: ArrayList<V>) {
val z = y["", w]
bar(z)
}
fun <V> get(s: String, w: ArrayList<V>): String {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -0,0 +1,8 @@
// "Create function 'get' from usage" "true"
fun x (y: Any) {
val z: Any = y[""]
}
fun Any.get(s: String): Any {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@@ -0,0 +1,10 @@
// "Create function 'get' from usage" "true"
class Foo<T> {
fun <S> x (y: Foo<Iterable<S>>) {
val z: Iterable<S> = y[""]
}
fun get(s: String): T {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -0,0 +1,10 @@
// "Create function 'get' from usage" "true"
class Foo<T, S: Iterable<T>> {
fun <U> x (y: Foo<U, Iterable<U>>) {
val z: U = y[""]
}
fun get(s: String): T {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -0,0 +1,10 @@
// "Create function 'get' from usage" "true"
class Foo<T> {
fun <T, V> x (y: Foo<Iterable<T>>, w: Iterable<V>) {
val z: Iterable<T> = y["", w]
}
fun <V> get(s: String, w: Iterable<V>): T {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -0,0 +1,12 @@
// "Create function 'get' from usage" "true"
import java.util.ArrayList
class Foo<T> {
fun <T, V> x (y: Foo<List<T>>, w: ArrayList<V>, v: T) {
val z: Iterable<T> = y["", w, v]
}
fun <V, T1> get(s: String, w: ArrayList<V>, v: T1): T {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -0,0 +1,12 @@
// "Create function 'get' from usage" "true"
import java.util.ArrayList
class Foo<T> {
fun x (y: Foo<List<T>>, w: ArrayList<T>) {
val z: Iterable<T> = y["", w]
}
fun get(s: String, w: T): T {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -0,0 +1,12 @@
// "Create function 'get' from usage" "true"
import java.util.ArrayList
class Foo<S> {
fun <T> x (y: Foo<List<T>>, w: ArrayList<T>) {
val z: Iterable<T> = y["", w]
}
fun get(s: String, w: S): S {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -0,0 +1,6 @@
// "Create function 'get' from usage" "true"
class Foo<T> {
fun x (y: Foo<Iterable<T>>) {
val z: Iterable<T> = y<caret>[""]
}
}
@@ -0,0 +1,6 @@
// "Create function 'get' from usage" "true"
class Foo<T> {
fun <T> x (y: Foo<List<T>>, w: java.util.ArrayList<T>) {
val z: Iterable<T> = y<caret>["", w]
}
}
@@ -0,0 +1,5 @@
// "Create function 'get' from usage" "true"
class Foo<T>
fun <T> x (y: Foo<List<T>>, w: java.util.ArrayList<T>) {
val z: Iterable<T> = y<caret>["", w]
}
@@ -0,0 +1,5 @@
// "Create function 'get' from usage" "true"
class Foo<T>
fun <T> x (y: Foo<List<T>>, w: java.util.ArrayList<T>) {
val z = y<caret>["", w]
}
@@ -0,0 +1,10 @@
// "Create function 'get' from usage" "true"
import java.util.ArrayList
class Foo<T> {
fun bar(arg: String) { }
fun <T, V> x (y: Foo<List<T>>, w: ArrayList<V>) {
val z = y<caret>["", w]
bar(z)
}
}
@@ -0,0 +1,4 @@
// "Create function 'get' from usage" "true"
fun x (y: Any) {
val z: Any = y<caret>[""]
}
@@ -0,0 +1,6 @@
// "Create function 'get' from usage" "true"
class Foo<T> {
fun <S> x (y: Foo<Iterable<S>>) {
val z: Iterable<S> = y<caret>[""]
}
}
@@ -0,0 +1,6 @@
// "Create function 'get' from usage" "true"
class Foo<T, S: Iterable<T>> {
fun <U> x (y: Foo<U, Iterable<U>>) {
val z: U = y<caret>[""]
}
}
@@ -0,0 +1,6 @@
// "Create function 'get' from usage" "true"
class Foo<T> {
fun <T, V> x (y: Foo<Iterable<T>>, w: Iterable<V>) {
val z: Iterable<T> = y<caret>["", w]
}
}
@@ -0,0 +1,8 @@
// "Create function 'get' from usage" "true"
import java.util.ArrayList
class Foo<T> {
fun <T, V> x (y: Foo<List<T>>, w: ArrayList<V>, v: T) {
val z: Iterable<T> = y<caret>["", w, v]
}
}
@@ -0,0 +1,8 @@
// "Create function 'get' from usage" "true"
import java.util.ArrayList
class Foo<T> {
fun x (y: Foo<List<T>>, w: ArrayList<T>) {
val z: Iterable<T> = y<caret>["", w]
}
}
@@ -0,0 +1,8 @@
// "Create function 'get' from usage" "true"
import java.util.ArrayList
class Foo<S> {
fun <T> x (y: Foo<List<T>>, w: ArrayList<T>) {
val z: Iterable<T> = y<caret>["", w]
}
}

Some files were not shown because too many files have changed in this diff Show More